CVE-2026-49844: Log4j API: NaN/Infinity breaks JSON log serialization

GHSA-qv9r-c865-cp47 MEDIUM
Published July 10, 2026
CISO Take

Apache Log4j API's JsonTemplateLayout message resolver (and any consumer of MapMessage.asJson()) emits bare NaN/Infinity/-Infinity tokens when a MapMessage carries a non-finite floating-point value, producing output that violates RFC 8259 and is not valid JSON. This is not remote code execution and there is no public exploit, PoC, or KEV/EPSS signal — the practical impact is corrupted log records that can break downstream JSON parsers, including SIEM ingestion, log analytics, and any AI-assisted anomaly-detection pipeline that expects well-formed JSON events. Blast radius is proportional to how widely you rely on JsonTemplateLayout's message resolver across JVM-based services (a very common pattern in enterprise Java stacks, including MLOps and data pipelines built on the JVM). Upgrade org.apache.logging.log4j:log4j-api to 2.25.5 or 2.26.1; until patched, monitor log ingestion pipelines for parse failures on fields that echo user- or model-derived numeric values (confidence scores, anomaly scores, metrics) that could go non-finite.

Sources: NVD logging.apache.org

What is the risk?

Low-to-moderate risk. The defect (CWE-116, improper encoding) causes malformed JSON output rather than any memory-safety, injection, or authentication issue — there is no code execution or data exfiltration path. Exploitability is trivial for an attacker who can influence a floating-point value that ends up in a MapMessage logged through JsonTemplateLayout's message resolver, but the payoff is limited to breaking or corrupting the resulting log record and any tooling that parses it strictly as JSON. No CVSS vector, EPSS score, CISA KEV listing, or public exploit/scanner exists at time of publication, and severity is rated medium by the vendor. The real-world risk is concentrated in environments where log integrity feeds compliance evidence or automated detection logic.

How does the attack unfold?

Entry point
Attacker identifies a JVM-based service that logs a MapMessage via JsonTemplateLayout's message resolver and that includes an attacker-influenceable numeric field.
Trigger
Attacker supplies input causing that field to resolve to NaN, Infinity, or -Infinity (e.g., a division-by-zero or malformed numeric submission).
Malformed output
MapMessage.asJson() emits the bare non-finite token, producing a log record that is not valid RFC 8259 JSON.
Impact
Downstream log ingestion, SIEM parsing, or AI-assisted monitoring tooling fails to parse the record, corrupting observability data or degrading automated detection.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
Microsoft APM maven >= 2.13.1, < 2.25.5 2.25.5
3.6K Pushed 2d ago 67% patched ~7d to patch Full package profile →
org.apache.logging.log4j:log4j-api No patch

How severe is it?

CVSS 3.1
N/A
EPSS
0.8%
chance of exploitation in 30 days
Higher than 54% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

What should I do?

1 step
  1. Upgrade org.apache.logging.log4j:log4j-api to 2.25.5 or 2.26.1, both of which emit RFC 8259-compliant JSON for non-finite values. Where immediate upgrade isn't possible, validate/sanitize numeric fields (reject or coerce NaN/Infinity to null or a sentinel string) before they reach MapMessage logging, especially for fields derived from model outputs or external input. Add log-pipeline health checks that alert on JSON parse failures in Log4j-sourced streams, since a spike could indicate either this defect firing or an attacker deliberately probing for it. Track org.apache.logging.log4j:log4j-api as a dependency across JVM services and confirm patched versions via SBOM/dependency scanning.

How is it classified?

DoS Framework

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 12 - Record-keeping
NIST AI RMF
MEASURE 2.7 - AI system monitoring and logging mechanisms are documented and evaluated

Frequently Asked Questions

What is CVE-2026-49844?

Apache Log4j API's JsonTemplateLayout message resolver (and any consumer of MapMessage.asJson()) emits bare NaN/Infinity/-Infinity tokens when a MapMessage carries a non-finite floating-point value, producing output that violates RFC 8259 and is not valid JSON. This is not remote code execution and there is no public exploit, PoC, or KEV/EPSS signal — the practical impact is corrupted log records that can break downstream JSON parsers, including SIEM ingestion, log analytics, and any AI-assisted anomaly-detection pipeline that expects well-formed JSON events. Blast radius is proportional to how widely you rely on JsonTemplateLayout's message resolver across JVM-based services (a very common pattern in enterprise Java stacks, including MLOps and data pipelines built on the JVM). Upgrade org.apache.logging.log4j:log4j-api to 2.25.5 or 2.26.1; until patched, monitor log ingestion pipelines for parse failures on fields that echo user- or model-derived numeric values (confidence scores, anomaly scores, metrics) that could go non-finite.

Is CVE-2026-49844 actively exploited?

No confirmed active exploitation of CVE-2026-49844 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-49844?

Upgrade org.apache.logging.log4j:log4j-api to 2.25.5 or 2.26.1, both of which emit RFC 8259-compliant JSON for non-finite values. Where immediate upgrade isn't possible, validate/sanitize numeric fields (reject or coerce NaN/Infinity to null or a sentinel string) before they reach MapMessage logging, especially for fields derived from model outputs or external input. Add log-pipeline health checks that alert on JSON parse failures in Log4j-sourced streams, since a spike could indicate either this defect firing or an attacker deliberately probing for it. Track org.apache.logging.log4j:log4j-api as a dependency across JVM services and confirm patched versions via SBOM/dependency scanning.

What systems are affected by CVE-2026-49844?

This vulnerability affects the following AI/ML architecture patterns: model serving (JVM-based inference services), MLOps/observability logging pipelines, SIEM and log-analytics ingestion feeding AI-assisted detection.

What is the CVSS score for CVE-2026-49844?

No CVSS score has been assigned yet.

What is the AI security impact?

Affected AI Architectures

model serving (JVM-based inference services)MLOps/observability logging pipelinesSIEM and log-analytics ingestion feeding AI-assisted detection

Compliance Controls Affected

EU AI Act: Article 12
NIST AI RMF: MEASURE 2.7

What are the technical details?

Original Advisory

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.

Exploitation Scenario

An adversary identifies a JVM-based service (e.g., a model-serving API or MLOps component) that logs a MapMessage containing a numeric field they can influence — for example, a model confidence score, latency metric, or telemetry value submitted via an API parameter. By supplying a value that resolves to NaN or Infinity (e.g., via a division-by-zero condition or an out-of-range input), the attacker causes JsonTemplateLayout's message resolver to emit a bare NaN/Infinity token in the log's JSON payload. This corrupts the log record, potentially breaking the downstream log ingestion pipeline or SIEM parser, disrupting security monitoring, or — in more sophisticated cases — being used defensively by an attacker to blind automated detection tooling that depends on parsing that log stream, effectively masking other malicious activity occurring around the same event.

Weaknesses (CWE)

CWE-116 — Improper Encoding or Escaping of Output: The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.

  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using the ESAPI Encoding control [REF-45] or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error. Alternately, use built-in functions, but consider using wrappers in case those functions are discovered to have a vulnerability.
  • [Architecture and Design] If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated. For example, stored procedures can enforce database query structure and reduce the likelihood of SQL injection.

Source: MITRE CWE corpus.

Timeline

Published
July 10, 2026
Last Modified
August 13, 2026
First Seen
July 11, 2026

Related Vulnerabilities