Skip to main content
Mallory
Medium

Invalid JSON output in Apache Log4j JsonTemplateLayout

IdentifiersCVE-2026-34481CWE-116· Improper Encoding or Escaping of…

Apache Log4j JsonTemplateLayout, in versions up to and including 2.25.3, improperly serializes non-finite floating-point values such as NaN, Infinity, and -Infinity when they appear in logged events. Because these values are not permitted by RFC 8259 JSON, the layout can emit invalid JSON records. The issue is exploitable only when an application is configured to use JsonTemplateLayout and logs a MapMessage containing an attacker-controlled floating-point value. The flaw affects log output generation rather than direct code execution, and can cause downstream systems that consume structured logs to reject or fail to index affected records.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can cause affected applications to generate malformed JSON log entries. Downstream log processing, parsing, forwarding, or indexing systems may reject those records or fail to ingest them, resulting in loss of visibility, broken observability pipelines, and potential disruption of monitoring or audit workflows for affected events.

Mitigation

If you can’t patch tonight, do this now.

Until patching is completed, reduce exposure by avoiding JsonTemplateLayout where feasible and by preventing attacker-controlled non-finite floating-point values from being included in logged MapMessage content. Input validation or normalization of floating-point values before logging can help prevent malformed JSON output.

Remediation

Patch, then assume compromise.

Upgrade Apache Log4j JSON Template Layout to version 2.25.4 or later. The provided content specifically states that version 2.25.4 corrects this issue.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Apache Software FoundationLog4japplication
Apache Software FoundationLog4j Layout Template Jsonapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity4

Community discussion across Reddit, Mastodon, and other social sources.