ppkarwasz opened a new pull request, #51:
URL: https://github.com/apache/logging-site/pull/51
Reports claiming that `${ctx:...}` lookups let attackers control the Log4j
configuration are among the most frequent we receive, most recently
apache/logging-log4j2#4425. They differ only in the attribute that receives the
value: file names, host names and ports, routing keys, script attributes or
layout patterns. The existing *Path Traversal* entry covers only the first case.
This adds a `#untrusted-interpolation` entry (CWE-15) that:
- lists the variants reported so far and links back from the *Path
Traversal* entry;
- explains why they are not vulnerabilities: the operator chooses which
expressions appear in which attributes, and the threat model makes the operator
responsible for using only trusted sources;
- documents that configuration-time substitution of `${ctx:...}` reads the
thread context of the thread that loads or reloads the configuration, and that
the substituted value is then processed like any operator-written value (e.g.
parsed as pattern syntax), a behavior users rely on;
- states the boundary that stays in scope: each expression is evaluated at
most once per evaluation context, and a way around that should be reported (cf.
CVE-2021-45046 and CVE-2021-45105);
- gives recommendations: validate values before `ThreadContext.put`, prefer
`%X{key}` over `${ctx:key}` in layouts, keep untrusted sources out of
attributes that select a destination or run code, and bound the Routing
appender with a purge policy.
Related: apache/logging-log4j2#4181 (RoutingAppender security documentation).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]