Skip to content

Add a Security FAQ entry on untrusted data in interpolated configuration - #51

Merged
ppkarwasz merged 1 commit into
mainfrom
docs/faq-untrusted-interpolation
Nov 13, 2026
Merged

ppkarwasz merged 1 commit into
mainfrom
docs/faq-untrusted-interpolation

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

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

Reports claiming that `${ctx:...}` lookups let attackers control the configuration are among the most frequent we receive. They only differ in the attribute receiving the value: file names, network destinations, routing keys, script attributes or layout patterns. The new entry explains why the operator, who chooses which expressions appear in which attributes, is responsible for using only trusted sources, documents that configuration-time substitution reads the thread context of the configuring thread, and states the boundary that remains in scope: each expression is evaluated at most once per evaluation context.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>

@FreeAndNil FreeAndNil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ppkarwasz
ppkarwasz merged commit b54add3 into main Nov 13, 2026
5 checks passed
@ppkarwasz
ppkarwasz deleted the docs/faq-untrusted-interpolation branch November 13, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants