
log4j 2025/2026 年 7 条「配置静默失效」CVE 自查:按 CVE×模块 判定 4 个模块,结构化解析 log4j2 配置做 applicability 降噪,并算出该升到哪个版本才一次到位(6 条写 2.25.4,但有一条要 2.25.5,而它 Dependabot 报不出来) CVE-2026-49844 / CVE-2026-34477
A self-check tool for the 2025/2026 batch of Log4j "silent configuration failure" advisories. Zero runtime dependencies, a single jar, no network access.
⚠️ Let's be clear about the scope first: this entire batch is medium severity, not a single RCE among them — it's not the Log4Shell kind. What they have in common is that configuration silently stops working without any error being raised — properties are silently ignored, properties are silently renamed, log entries are silently dropped. So you can't tell whether you're affected just by looking at the version number; you have to read the configuration. If you're looking for CVE-2021-44228 (Log4Shell), this tool won't help you.
java -jar log4j-check.jar app.jar # fat jar 里带配置,一步到位
java -jar log4j-check.jar ./target ./src # 构建产物 + 源码
java -jar log4j-check.jar ~/.m2/repository --no-config
Dependabot tells you "log4j has N vulnerabilities". This tool answers three things it doesn't:
log4j2.xml, which can be read, and read accurately.Of these 7 entries, the fixed versions for 6 are all ≤ 2.25.4. So the vast majority of people arrive at the answer "upgrade to 2.25.4".
But CVE-2026-49844 requires 2.25.5 (the 2.26 line requires 2.26.1). Its advisory text states that it is itself
an incomplete fix for CVE-2026-34481:
The fix released in version
2.25.4did not cover all affected code paths. CVE-2026-49844 was assigned to the remaining issue …
📌 Correction (2026-08-16)
This section originally said "and this is exactly the one that Dependabot structurally cannot report" — that statement is now only half true.
GHSA-qv9r-c865-cp47was converted by GitHub toreviewedon 2026-08-13 and had its package information filled in; the two ranges added are>= 2.13.1, < 2.25.5and>= 2.26.0, < 2.26.1:
- ✅ People running 2.x can now receive Dependabot alerts.
- 🔴 But the
3.xpreview line (3.0.0-alpha1~3.0.0-beta2) still has no corresponding range, so that line still cannot be reported.The upgrade conclusion has not changed at all —
log4j-apistill requires 2.25.5 (the 2.26 line requires 2.26.1). What changed is only "whether machines can see it". This tool's decision table has been updated line by line per version line, and the numbers printed in the report are computed from the table, no longer hardcoded.🔑 This matter itself is more worth remembering than the original example: the shape of an advisory can be filled in by upstream over time, and the conclusion from your last scan will not update itself, nor will anyone notify you. "It was scanned at the time" and "it is safe now" are two different things.
Its GitHub advisory (GHSA-qv9r-c865-cp47) before 2026-08-13 was unreviewed,
and its vulnerabilities array was empty — no package name, no version range, no fixed version.
During that period Dependabot had no data it could compare against your dependency tree.
The same was true on OSV.dev at the time: the other 6 entries could all obtain Maven coordinates through the GHSA alias, only this one could not
(in OSV it did not even have a GHSA alias). This is independent corroboration from a third source;
tools/recheck_before_publish.py re-verifies this every time it reruns
(the script now also reports the fact that it "has been filled in" itself).
🔴 Do not read this entry as "Dependabot is not useful". It is "this data did not exist at the time", not "this tool has a bug".
unreviewedis a normal process state on GitHub, and the filling in on 08-13 is precisely that process completing normally.
The other chain is CVE-2025-68161 (2.25.3) → CVE-2026-34477 (2.25.4):
the verifyHostName property was introduced in 2.12.0, yet all the way through 2.25.3 it was silently ignored,
so configuring it was the same as not configuring it. People who upgraded to 2.25.3 per 68161 and configured hostname verification using the property (rather than a system property) are still affected.
| Module | Matching entries | Should upgrade to |
|---|---|---|
log4j-core | 34477 / 34478 / 34480 / 68161 | 2.25.4 |
log4j-api | 49844 | 2.25.5 (2.26 line: 2.26.1) |
log4j-1.2-api | 34479 | 2.25.4 |
log4j-layout-template-json | 34481 | 2.25.4 |
The target versions are not the same number. And the vast majority of projects only write log4j-core in their pom
— looking up by that single coordinate finds only 4 entries, and the other 3 simply do not exist for them.
This tool scans the versions of the four modules separately and makes determinations separately. When the four module versions diverge (BOM overrides, manual exclusions, two generations of jars stuffed into an old WAR), it will explicitly report it.
| CVE | Trigger condition (taken from the official text) |
|---|---|
CVE-2026-34477 | The verifyHostName attribute of <Ssl> + Socket / Syslog / SMTP appender |
CVE-2025-68161 | SocketAppender + TLS |
CVE-2026-34478 | Configuring Rfc5424Layout directly (those using SyslogAppender are not affected) |
CVE-2026-34480 | XmlLayout of log4j-core |
CVE-2026-34479 | The bridge's Log4j1XmlLayout, or the log4j 1 compatibility layer + org.apache.log4j.xml.XMLLayout |
CVE-2026-34481 | JsonTemplateLayout + floating-point values in MapMessage/ObjectMessage |
CVE-2026-49844 | The message resolver of JsonTemplateLayout, or MapMessage.asJson() |
Measured (real artifacts, see below): the same set of four modules with the affected versions installed,
Console + RollingFile + PatternLayout) → the version layer reports 7 items, 0 are true positivesSocket + <Ssl verifyHostName> + Rfc5424Layout + XmlLayout → reports 7 items, 4 are true positivesThe two negative criteria are stated verbatim in the official documentation, documented separately:
Those using SyslogAppender do not match 34478; those using only the HTTP appender's verifyHostname do not match 34477.
This category and "I didn't find it" have completely different levels of reliability — the former is backed by the original text, the latter is merely something we didn't see.
🔴
verifyHostName(capital N,<Ssl>, affected) andverifyHostname(lowercase n, HTTP appender, officially documented as not affected) differ by only one letter's case, yet the conclusions are completely opposite. Likewise,XmlLayout(34480, log4j-core) is a substring ofLog4j1XmlLayout(34479, bridge). Grepping names alone will make people bear CVEs that aren't theirs. So the configuration layer does structured parsing rather than text matching.