mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-28 04:24:59 +02:00
Merge pull request #287 from adrianosela/main
[CVE-2024-51735/GHSA-wvv7-wm5v-w2gv] Fix XSS In Markdown Resolver
This commit is contained in:
@@ -2,6 +2,7 @@ package core
|
||||
|
||||
import (
|
||||
"path"
|
||||
"text/template"
|
||||
|
||||
"fmt"
|
||||
"os"
|
||||
@@ -111,6 +112,7 @@ func (r *Runner) ResolveContentSrc(tag string) string {
|
||||
}
|
||||
|
||||
if strings.Contains(tag, "shorten=true") || len(fileContent) > r.Opt.MDCodeBlockLimit {
|
||||
fileContent = template.HTMLEscapeString(fileContent) // sanitize file content to prevent XSS
|
||||
return extendTag(fileContent)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user