CVE-2026-49844
Medium · 5.9CVSS
5.9
EPSS
0.6%
Published
Jul 10, 2026
CISA due date
—
Cloudanix analysis
A logging component can emit broken log records when certain unusual numbers appear, which may stop log-analysis systems from reading the logs correctly.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Improper encoding of non-finite floating-point values (NaN, Infinity, -Infinity) during MapMessage JSON serialization emits bare RFC-8259-prohibited tokens instead of valid JSON literals.
Why it matters to the business
Log ingestion pipelines that rely on strict JSON may fail or drop records, leading to incomplete audit trails, delayed incident response, and potential compliance gaps in high-volume logging environments.
How an attack unfolds
An attacker who can influence a floating-point field inside a MapMessage logged via JsonTemplateLayout supplies a non-finite value; MapMessage.asJson() then serializes it as an unquoted token, producing malformed JSON that downstream parsers reject and may corrupt the enclosing log event.
How to fix it
Upgrade Apache Log4j API to version 2.25.5 or 2.26.1; verify that all direct and transitive dependencies pull the corrected artifact and re-test any custom message templates that serialize MapMessage content as JSON.
How to confirm the fix worked
After upgrade, log a MapMessage containing NaN/Infinity values and confirm the emitted JSON is RFC-8259 compliant (quoted strings or null); scan build manifests for any remaining 2.13.1–2.25.4 or 2.26.0 jars.
Typical attack path
- Locate code paths that log attacker-controlled values inside MapMessage objects using JsonTemplateLayout or equivalent JSON message formatting
- Inject a non-finite IEEE-754 value (NaN, Infinity, or -Infinity) into the controlled field
- Trigger the log statement so MapMessage.asJson() emits the bare token
- Observe rejection or corruption by any strict JSON consumer in the log pipeline
How to detect it
Search centralized log stores and SIEM indexes for JSON parse exceptions or log records containing unquoted NaN, Infinity, or -Infinity tokens originating from MapMessage serialization; correlate with application log volume spikes or ingestion pipeline alerts.
- NaN
- Infinity
- -Infinity
- MapMessage.asJson
- JsonTemplateLayout.*message
What your security team should do
- Immediately upgrade all Apache Log4j API instances to 2.25.5 or 2.26.1
- Audit applications for use of JsonTemplateLayout event-template-resolver message or direct calls to MapMessage.asJson()
- Add automated tests that exercise non-finite numeric values in MapMessage logging
- Monitor log-ingestion error rates for sudden JSON parse failures
The record
Improper encoding of non-finite floating-point values during MapMessage JSON serialization in Apache Log4j API produces output that is not valid JSON. This issue affects Apache Log4j API versions 2.13.1 through 2.25.4 and version 2.26.0. The fix for CVE-2026-34481 did not cover all code paths: when a MapMessage contains a non-finite IEEE 754 value (NaN, Infinity, or -Infinity), MapMessage.asJson() emits the corresponding bare token. RFC 8259 does not permit these tokens, so a conformant parser rejects the resulting document. The defect is reachable only when both of the following conditions hold: * The application uses the message resolver https://logging.apache.org/log4j/2.x/manual/json-template-layout.html#event-template-resolver-message of JsonTemplateLayout or any other layout that relies on MapMessage.asJson() or MapMessage.getFormattedMessage(new String[]{"JSON"}). * The application logs a MapMessage that contains an attacker-controlled floating-point value. An attacker who can supply a non-finite value can cause the affected layout to emit malformed JSON, which may corrupt the enclosing log record or disrupt downstream log ingestion and parsing. Users are advised to upgrade to Apache Log4j API 2.25.5 or 2.26.1, both of which emit RFC 8259-compliant JSON for non-finite values.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-63471 fastapi-code-generator creates FastAPI applications from OpenAPI files. CWE-116
- CVE-2026-63470 fastapi-code-generator creates FastAPI applications from OpenAPI files. CWE-116
- CVE-2026-63469 fastapi-code-generator creates FastAPI applications from OpenAPI files. CWE-116
- CVE-2026-44266 Elo is a purely functional expression language for no-code tools. CWE-116
- CVE-2024-12139 The error handling implementation fails to properly sanitize or validate user-supplied… CWE-116
- CVE-2026-83559 Improper encoding or escaping of output in Apache Wicket. CWE-116
- CVE-2026-63346 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-116
- CVE-2026-63344 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-116