Active
Project:
Drupal core
Version:
main
Component:
file.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2024 at 15:51 UTC
Updated:
20 Aug 2026 at 09:53 UTC
Jump to comment: Most recent
The ManagedFile form element plugin makes use of a #prefix to render out status messages in Drupal\file\Element\ManagedFile::uploadAjaxCallback. This means that any output from the status message template will be ran through Drupal's XSS filter -- which is known to cause problems.
<svg> sprite.<svg> sprite! The design has been broken!Given this does break the Olivero design, I feel this is a legitimate bug that should be resolved.
By the time the status message template has finished rendering, this output should be trusted enough not to need this degree of XSS filtering [citation needed]. Can this be done safely?
Ask the security team to chime in.
TBD
TBD
TBD
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| olivery-system-message-no-sprite.png | 26.28 KB | luke.leber | |
| olivero-system-message-sprite.png | 7.54 KB | luke.leber |
Comments
Comment #2
cilefen commentedThis seems similar in nature to #3455356: Support displaying a message that correctly validates file uploads for the Gin theme.. Do they have a common cause?
Comment #3
luke.leberI believe that the root cause is that Drupal's XSS utility is somewhat dated. There are a pile of "safe" HTML5 tags that are stripped out -- a subset of SVG's elements among them.
This is a somewhat heavy-handed approach that immediately comes to mind to resolve this in the mean-time:
Comment #4
naveenvalechaThis looks related
Comment #5
quietone commentedComment #7
fagoI've opened #3618230: Adopt the ajax MessageCommand for file uploads what ports the message rendering over to the Drupal ajax command we have, and that way, also fix this bug. Please take a look.