CVE-2024-55875 http4k has a potential XXE (XML External Entity Injection) vulnerability

Critical 9.8 Published Updated

Attackers can exploit XML parsing flaws in http4k to read local files, trigger SSRF, or cause denial of service via entity expansion.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-55875?

CVE-2024-55875 is a critical vulnerability in http4k, published on 12 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

http4k is a functional toolkit for Kotlin HTTP applications. Prior to version 6.50.0.0, there is a potential XXE (XML External Entity Injection) vulnerability when http4k handling malicious XML contents within requests, which might allow attackers to read local sensitive information on server, trigger Server-side Request Forgery and even execute code under some circumstances. The original fix shipped in v5.41.0.0 / v4.50.0.0 closed the documented external-entity attack class (SSRF, local-file disclosure, code execution) by setting `ACCESS_EXTERNAL_DTD=""`, `ACCESS_EXTERNAL_SCHEMA=""`, and `isExpandEntityReferences=false` on the default `DocumentBuilderFactory`. A residual gap remained: the parser still accepted documents containing `<!DOCTYPE>` declarations even though external entity resolution was blocked. This left open billion-laughs-style internal entity expansion DoS attacks against any application using `Body.xml()` or `Document.asXmlDocument()` on untrusted XML. v6.50.0.0 closes this residual by adding `disallow-doctype-decl=true` and `FEATURE_SECURE_PROCESSING=true` to `defaultXmlParsingConfig`. Any document containing a `<!DOCTYPE>` is now rejected at parse time.

Weakness: CWE-918, CWE-611, CWE-200

Which versions are affected by CVE-2024-55875?

2 open source packages ship an affected version, including org.http4k:http4k-format-xml.

PackageAffectedFixed in
org.http4k:http4k-format-xml MavenAll versions6.50.0.0
org.http4k:http4k-format-xml MavenAll versions6.50.0.0

How do I fix CVE-2024-55875?

Upgrade org.http4k:http4k-format-xml to 6.50.0.0 or later.

Is CVE-2024-55875 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-55875 exists.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-7mj5-hjjj-8rgw.

Is CVE-2024-55875 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free