CVE-2026-49844: CWE-116 Improper Encoding or Escaping of Output in Apache Software Foundation Apache Log4j API
CVE-2026-49844 is a medium severity vulnerability in Apache Log4j API affecting versions 2.13.1 through 2.25.4, 2.26.0, and 3.0.0-alpha1. It involves improper encoding of non-finite floating-point values (NaN, Infinity, -Infinity) during MapMessage JSON serialization, resulting in output that is not valid JSON. This can cause malformed log entries and disrupt downstream log processing when using certain JSON layouts. Users are advised to upgrade to versions 2.25.5 or 2.26.1 which produce RFC 8259-compliant JSON for these values.
AI Analysis
Technical Summary
The vulnerability arises because the fix for a previous issue (CVE-2026-34481) did not cover all code paths in Apache Log4j API's MapMessage JSON serialization. When a MapMessage contains non-finite IEEE 754 floating-point values, the asJson() method emits bare tokens (NaN, Infinity, -Infinity) which are invalid according to RFC 8259 JSON standards. This defect manifests only if the application uses the JsonTemplateLayout's message resolver or any layout relying on MapMessage.asJson() or MapMessage.getFormattedMessage(new String[]{"JSON"}), and logs a MapMessage containing attacker-controlled non-finite values. The malformed JSON output can corrupt log records or disrupt log ingestion and parsing downstream. The issue affects Apache Log4j API versions 2.13.1 through 2.25.4, 2.26.0, and 3.0.0-alpha1. Upgrading to versions 2.25.5 or 2.26.1 resolves the issue by emitting compliant JSON.
Potential Impact
An attacker able to supply non-finite floating-point values in MapMessage logs can cause the affected JSON layouts to emit malformed JSON. This may corrupt the log record or disrupt downstream log ingestion and parsing systems that expect valid JSON. There is no indication of direct code execution or privilege escalation. The impact is primarily on log integrity and reliability of log processing pipelines.
Mitigation Recommendations
Users should upgrade Apache Log4j API to version 2.25.5 or 2.26.1, which fix the improper encoding of non-finite floating-point values in JSON serialization. No other mitigations are indicated. Patch status is not explicitly stated as 'official-fix' in the vendor advisory content, but the description clearly advises upgrading to these fixed versions. Therefore, a fix is available via upgrading to these versions.
CVE-2026-49844: CWE-116 Improper Encoding or Escaping of Output in Apache Software Foundation Apache Log4j API
Description
CVE-2026-49844 is a medium severity vulnerability in Apache Log4j API affecting versions 2.13.1 through 2.25.4, 2.26.0, and 3.0.0-alpha1. It involves improper encoding of non-finite floating-point values (NaN, Infinity, -Infinity) during MapMessage JSON serialization, resulting in output that is not valid JSON. This can cause malformed log entries and disrupt downstream log processing when using certain JSON layouts. Users are advised to upgrade to versions 2.25.5 or 2.26.1 which produce RFC 8259-compliant JSON for these values.
CVSS v4.0
Score 6.3medium
Affected software
pkg:maven/Apache Software Foundation/org.apache.logging.log4j:log4j-apicpe:2.3:a:apache:log4j_api:*:*:*:*:*:*:*:*Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises because the fix for a previous issue (CVE-2026-34481) did not cover all code paths in Apache Log4j API's MapMessage JSON serialization. When a MapMessage contains non-finite IEEE 754 floating-point values, the asJson() method emits bare tokens (NaN, Infinity, -Infinity) which are invalid according to RFC 8259 JSON standards. This defect manifests only if the application uses the JsonTemplateLayout's message resolver or any layout relying on MapMessage.asJson() or MapMessage.getFormattedMessage(new String[]{"JSON"}), and logs a MapMessage containing attacker-controlled non-finite values. The malformed JSON output can corrupt log records or disrupt log ingestion and parsing downstream. The issue affects Apache Log4j API versions 2.13.1 through 2.25.4, 2.26.0, and 3.0.0-alpha1. Upgrading to versions 2.25.5 or 2.26.1 resolves the issue by emitting compliant JSON.
Potential Impact
An attacker able to supply non-finite floating-point values in MapMessage logs can cause the affected JSON layouts to emit malformed JSON. This may corrupt the log record or disrupt downstream log ingestion and parsing systems that expect valid JSON. There is no indication of direct code execution or privilege escalation. The impact is primarily on log integrity and reliability of log processing pipelines.
Mitigation Recommendations
Users should upgrade Apache Log4j API to version 2.25.5 or 2.26.1, which fix the improper encoding of non-finite floating-point values in JSON serialization. No other mitigations are indicated. Patch status is not explicitly stated as 'official-fix' in the vendor advisory content, but the description clearly advises upgrading to these fixed versions. Therefore, a fix is available via upgrading to these versions.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- apache
- Date Reserved
- 2026-06-01T20:15:42.977Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a51650f68715ace433b3d10
Added to database: 07/10/2026, 21:33:03 UTC
Last enriched: 07/10/2026, 21:47:37 UTC
Last updated: 07/10/2026, 22:33:45 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.