Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: prevent XSS for specific content types
Steven46d5307d7f21
diff --git a/server/router/api/v1/resource_service.go b/server/router/api/v1/resource_service.goindex ec1f609a9..43db4d18d 100644--- a/server/router/api/v1/resource_service.go+++ b/server/router/api/v1/resource_service.go@@ -188,6 +188,12 @@ func (s *APIV1Service) GetResourceBinary(ctx context.Context, request *v1pb.GetRif strings.HasPrefix(contentType, "text/") {contentType += "; charset=utf-8"}+ // Prevent XSS attacks by serving potentially unsafe files with a content type that prevents script execution.+ if strings.EqualFold(contentType, "image/svg+xml") ||+ strings.EqualFold(contentType, "text/html") ||+ strings.EqualFold(contentType, "application/xhtml+xml") {+ contentType = "application/octet-stream"+ }return &httpbody.HttpBody{ContentType: contentType,