# CVE-2026-34481: Apache Log4j JSON Template Layout: Improper serialization of non-finite floating-point values in JsonTemplateLayout

> Attackers can cause log processing failures by injecting non-finite floating-point values into logs using JsonTemplateLayout, requiring an upgrade to Log4j.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Apr 2026
- **Updated:** 11 Jul 2026
- **Also known as:** CLEANSTART-2026-CS40307, CLEANSTART-2026-NV45884, CLEANSTART-2026-QA30361, CLEANSTART-2026-RV51042, CLEANSTART-2026-SX30440, CLSA-2026-1784769579, DEBIAN-CVE-2026-34481, ECHO-ca39-a08f-f485, GHSA-w35j-pv5h-q9q9, MINI-28rp-w5rw-j3fj, MINI-2p74-j755-fc4r, MINI-386x-qf27-4268, MINI-3f92-66mg-v4pq, MINI-42mw-mr2x-q8mr, MINI-59rw-jmfv-g7hg, MINI-648w-qvhj-jmqf, MINI-696h-wr4r-gjpw, MINI-7c5r-qf3h-fxpp, MINI-8cff-mhc4-wrh5, MINI-9mgh-f6qm-qfxp, MINI-g8pp-89mj-2738, MINI-h9g5-qh2j-fq8h, MINI-hrxq-qc52-rq8f, MINI-m7rp-v6wr-hhpp, MINI-mjfv-pjcg-5pgr, MINI-pv49-5g8p-jxx5, MINI-v2gr-xggj-xf8h, MINI-v5f8-ph87-37g5, MINI-vpw7-4m27-mhx9, MINI-wr35-4qpp-q237, MINI-xcwf-44p5-h5pj, ROOT-APP-MAVEN-CVE-2026-34481, UBUNTU-CVE-2026-34481

## What is CVE-2026-34481?

CVE-2026-34481 is a medium-severity vulnerability in Apache Log4j JSON Template Layout, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Apache Log4j's  JsonTemplateLayout https://logging.apache.org/log4j/2.x/manual/json-template-layout.html , 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, or logs an object directly (e.g., via Logger.info(Object), which wraps it in an ObjectMessage), where the message contains an attacker-controlled floating-point value.

Users are advised to upgrade to Apache Log4j JSON Template Layout 2.25.4, which corrects this issue.

Note: The fix released in version 2.25.4 did not cover all affected code paths. CVE-2026-49844 was assigned to the remaining issue, which concerns the MapMessage.asJson() serialization in Apache Log4j API and is fixed in versions 2.25.5 and 2.26.1.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2026-34481?

4 open source packages ship an affected version, including org.apache.logging.log4j:log4j-layout-template-json. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.logging.log4j:log4j-layout-template-json` | Maven | From 2.14.0 | 2.25.4 |
| `org.apache.logging.log4j:log4j-layout-template-json` | Maven | From 2.14.0 | 2.25.4 |
| `org.apache.logging.log4j:log4j-layout-template-json` | Maven | From 3.0.0-alpha1 to 3.0.0-beta3 | None |
| `org.apache.logging.log4j:log4j-layout-template-json` | Maven | From 3.0.0-alpha1 to 3.0.0-beta3 | None |

Products: Apache Log4j.

## How do I fix CVE-2026-34481?

Upgrade org.apache.logging.log4j:log4j-layout-template-json to 2.25.4 or later.

## Is CVE-2026-34481 being exploited?

There is no known exploitation of CVE-2026-34481 in the wild and no public exploit code.

## Other vulnerabilities in Apache Log4j JSON Template Layout

- [CVE-2021-44228](https://insights.sbomify.com/CVE-2021-44228/): Apache Log4j2 Remote Code Execution (critical 10.0, exploited in the wild)
- [CVE-2021-45046](https://insights.sbomify.com/CVE-2021-45046/): Apache Log4j2 Deserialization of Untrusted Data (critical 9.0, exploited in the wild)
- [CVE-2022-23305](https://insights.sbomify.com/CVE-2022-23305/): SQL injection in JDBC Appender in Apache Log4j V1 (critical 9.8)
- [CVE-2017-5645](https://insights.sbomify.com/CVE-2017-5645/): Deserialization of Untrusted Data in Log4j (critical 9.8)
- [CVE-2022-23302](https://insights.sbomify.com/CVE-2022-23302/): Deserialization of untrusted data in JMSSink in Apache Log4j 1.x (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-34481 and fix it if it is affected.

What it is: CVE-2026-34481 is a medium-severity vulnerability in Apache Log4j JSON Template Layout, published on 10 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-34481 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.logging.log4j:log4j-layout-template-json (Maven): affected from 2.14.0; fixed in 2.25.4
- org.apache.logging.log4j:log4j-layout-template-json (Maven): affected from 2.14.0; fixed in 2.25.4
- org.apache.logging.log4j:log4j-layout-template-json (Maven): affected from 3.0.0-alpha1 up to 3.0.0-beta3; no fix listed
- org.apache.logging.log4j:log4j-layout-template-json (Maven): affected from 3.0.0-alpha1 up to 3.0.0-beta3; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-34481/ (Markdown: https://insights.sbomify.com/CVE-2026-34481/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-34481
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-34481
- OSV: https://osv.dev/vulnerability/CVE-2026-34481

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-34481/
Summaries are generated and may contain mistakes; the official description above is the record.
