Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-0743: update img header · answerdev/answer@860b1a3

Cross-site Scripting (XSS) - Generic in GitHub repository answerdev/answer prior to 1.0.4.

CVE
#xss#git

@@ -4,6 +4,7 @@ import (

“fmt”

“net/url”

“os”

“path”

“path/filepath”

“strings”

@@ -53,13 +54,26 @@ func (am *AvatarMiddleware) AvatarThumb() gin.HandlerFunc {

ctx.Next()

return

}

ext := strings.ToLower(path.Ext(filePath)[1:])

ctx.Header("content-type", fmt.Sprintf("image/%s", ext))

_, err = ctx.Writer.WriteString(string(avatarfile))

if err != nil {

log.Error(err)

}

ctx.Abort()

return

} else {

uUrl, err := url.Parse(u)

if err != nil {

ctx.Next()

return

}

_, urlfileName := filepath.Split(uUrl.Path)

uploadPath := am.serviceConfig.UploadPath

filePath := fmt.Sprintf("%s/%s", uploadPath, urlfileName)

ext := strings.ToLower(path.Ext(filePath)[1:])

ctx.Header("content-type", fmt.Sprintf("image/%s", ext))

}

ctx.Next()

}

Related news

GHSA-hjmr-xm25-36mh: Answer subject to Cross-site Scripting vulnerability

Cross-site Scripting (XSS) - Generic in GitHub repository answerdev/answer prior to 1.0.4.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda