CVE-2026-34481: Apache Log4j JSON Template Layout: Improper serialization of non-finite floating-point values in JsonTemplateLayout
Apache Log4j's JsonTemplateLayout
Other sources
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 MapMessage containing an attacker-controlled floating-point value.
Users are advised to upgrade to Apache Log4j JSON Template Layout 2.25.4, which corrects this issue.
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.apache.logging.log4j:log4j-layout-template-jsonto a version that resolves this vulnerability.Fixed in 3.0.0-beta3 - Upgrade
Upgrade
maven/org.apache.logging.log4j:log4j-layout-template-jsonto a version that resolves this vulnerability.Fixed in 2.25.4 - Upgrade
Upgrade
Apache Log4j JsonTemplateLayoutto a version that resolves this vulnerability.Fixed in 2.25.4 - Upgrade
Upgrade
Apache Log4j API (MapMessage.asJson serialization)to a version that resolves this vulnerability.Fixed in 2.25.5Patch CVE-2026-49844 - Upgrade
Upgrade
Apache Log4j API (MapMessage.asJson serialization)to a version that resolves this vulnerability.Fixed in 2.26.1Patch CVE-2026-49844
Event History
Frequently Asked Questions
What is the severity of CVE-2026-34481?
CVE-2026-34481 is classified as a high severity vulnerability due to improper serialization of non-finite floating-point values.
How do I fix CVE-2026-34481?
To fix CVE-2026-34481, upgrade your Log4j library to version 2.25.4 or later, or version 3.0.0-beta3.
What versions of Apache Log4j are affected by CVE-2026-34481?
CVE-2026-34481 affects Apache Log4j versions up to and including 2.25.3.
What does CVE-2026-34481 affect in Apache Log4j?
CVE-2026-34481 affects the JsonTemplateLayout functionality in Apache Log4j, producing invalid JSON output.
Is CVE-2026-34481 related to security issues in logging?
Yes, CVE-2026-34481 is a security vulnerability that impacts the integrity of JSON data being logged.