Skip to content

escape scope attribute names and values in DumpTag - #4316

Open
jmestwa-coder wants to merge 1 commit into
apache:2.xfrom
jmestwa-coder:taglib-dumptag-xss-escape
Open

escape scope attribute names and values in DumpTag#4316
jmestwa-coder wants to merge 1 commit into
apache:2.xfrom
jmestwa-coder:taglib-dumptag-xss-escape

Conversation

@jmestwa-coder

Copy link
Copy Markdown
Contributor

DumpTag (log:dump) writes the names and values of every attribute in the selected scope straight into the page:

  • request- and session-scope attributes are routinely attacker-influenced (a request parameter copied into a request attribute, a form bean, etc.), so any page using log:dump with those scopes emits reflected/stored XSS
  • doEndTag concatenated the attribute name and value into the HTML output with no escaping
  • both are now escaped with StringBuilders.escapeXml before writing, the same escaping HtmlLayout and Log4j1XmlLayout already apply to event data

Checklist

  • Base your changes on the 2.x branch
  • ./mvnw verify succeeds for the affected module
  • Changelog entry added under src/changelog/.2.x.x
  • Tests are provided

@jmestwa-coder
jmestwa-coder force-pushed the taglib-dumptag-xss-escape branch from bd78582 to 54f1587 Compare September 9, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant