mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
SECURITY: strip xlink:href
from uploaded SVGs (#21057)
This was inadvertently removed in 4c46c7e. In very specific scenarios, this could be used execute arbitrary JavaScript. Only affects instances where SVGs are allowed as uploads and CDN is not configured.
This commit is contained in:
@ -613,7 +613,7 @@ RSpec.describe UploadCreator do
|
||||
<g>
|
||||
<use id="valid-use" x="123" href="#pathdef" />
|
||||
</g>
|
||||
<use id="invalid-use1" href="https://svg.example.com/evil.svg" />
|
||||
<use id="invalid-use1" xlink:href="https://svg.example.com/evil.svg" />
|
||||
<use id="invalid-use2" href="data:image/svg+xml;base64,#{b64}" />
|
||||
</svg>
|
||||
XML
|
||||
|
Reference in New Issue
Block a user