CVE-2026-34481
Apache Log4j JSON Template Layout: Improper serialization of non-finite floating-point values in JsonTemplateLayout
Description
Apache Log4j's JsonTemplateLayout, in versions up to and including 2.25.3, produces invalid JSON output when log events contain non-finite floating-point values (NaN, Infinity, or -Infinity), which are prohibited by RFC 8259. This may cause downstream log processing systems to reject or fail to index affected records.
An attacker can exploit this issue only if both of the following conditions are met:
- The application uses
JsonTemplateLayout. - The application logs a
MapMessagecontaining an attacker-controlled floating-point value.
Users are advised to upgrade to Apache Log4j JSON Template Layout 2.25.4, which corrects this issue.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.apache.logging.log4j » log4j-layout-template-json | >= 2.14.0, < 2.25.4>= 3.0.0-alpha1, <= 3.0.0-beta3 | 2.25.4 |
Blast radius
43% of the dependent artifacts (533) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 7,189 |
| 2 hops | 20,909 |
| 3 hops | 8,518 |
| 4 hops | 7,163 |
| 5 hops | 3,698 |
| 6 hops | 1,731 |
Most used dependents
- org.apache.spark » spark-sql3,174 usages
- org.apache.spark » spark-core2,899 usages
- org.apache.spark » spark-mllib831 usages
- org.apache.spark » spark-streaming670 usages
- org.apache.spark » spark-hive633 usages
- org.apache.spark » spark-catalyst502 usages
- org.apache.solr » solr-core500 usages
- org.neo4j » neo4j-kernel279 usages
- org.neo4j » neo4j269 usages
- org.apache.solr » solr-test-framework181 usages
- org.apache.spark » spark-graphx143 usages
- org.opencms » opencms-core134 usages
- org.apache.spark » spark-yarn130 usages
- com.holdenkarau » spark-testing-base126 usages
- org.apache.spark » spark-repl110 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-34481
- Webhttps://github.com/apache/logging-log4j2/pull/4080
- Packagehttps://github.com/apache/logging-log4j2
- Webhttps://lists.apache.org/thread/n34zdv00gbkdbzt2rx9rf5mqz6lhopcv
- Webhttps://logging.apache.org/cyclonedx/vdr.xml
- Webhttps://logging.apache.org/log4j/2.x/manual/json-template-layout.html
- Webhttps://logging.apache.org/security.html#CVE-2026-34481
- Webhttp://www.openwall.com/lists/oss-security/2026/04/10/10
