This was originally reported as a private security issue, but has been approved for handling the public queue by the Drupal Security Team.
Problem/Motivation
The webform_submission_log submodule has a potential XSS vulnerability because it does not sanitize log messages before displaying them.
This could be a problem if some custom code logs a message containing unescaped user input.
Steps to reproduce
1. Enabling the webform_submission_log module
2. Call something like this:
\Drupal::logger('webform_submission')->error('<img src=x onerror=alert()>', $context);
3. Browse to /admin/structure/webform/submissions/log: the JS is executed.
(dblog does not have this problem, it always filters log messages against XSS.)
Proposed resolution
We could filter log messages with Xss::filterAdmin() before displaying them (dblog does this).
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork webform-3547533
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jrockowitz commentedComment #5
jrockowitz commentedRTBC if tests pass
Comment #7
liam morlandThis change cherry-picks cleanly onto 6.2.x.
Comment #8
jrockowitz commentedComment #10
benstallings commentedI just rebased, and this branch is looking good!
Comment #14
liam morlandThanks!