{"id":"CVE-2026-81875","aliases":["CVE-2026-81875","GHSA-3w98-rrpr-fprr"],"related":[],"kind":"vulnerability","state":"published","title":"HAPI FHIR: SHCParser unbounded DEFLATE decompression causes denial of service","summary":"HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.12, SHCParser in org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/SHCParser.java can consume attacker-controlled Smart Health Card JWT content whose header contains zip: \"DEF\" and whose small raw-DEFLATE payload expands to a very large value. SHCParser.decodeJWT() passes the decoded payload to SHCParser.inflate(), which accumulates all decompressed bytes in a ByteArrayOutputStream without an output-size limit before JSON parsing, and SHCParser.decompress() contains the same unbounded pattern. An application or validator service that accepts attacker-supplied SHC content can therefore suffer excessive heap allocation, severe garbage-collection pressure, request failure, process instability, or process termination. This issue is fixed in version 6.9.12.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.12, SHCParser in org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/SHCParser.java can consume attacker-controlled Smart Health Card JWT content whose header contains zip: \"DEF\" and whose small raw-DEFLATE payload expands to a very large value. SHCParser.decodeJWT() passes the decoded payload to SHCParser.inflate(), which accumulates all decompressed bytes in a ByteArrayOutputStream without an output-size limit before JSON parsing, and SHCParser.decompress() contains the same unbounded pattern. An application or validator service that accepts attacker-supplied SHC content can therefore suffer excessive heap allocation, severe garbage-collection pressure, request failure, process instability, or process termination. This issue is fixed in version 6.9.12.","source":"cvelist"},{"lang":"en","text":"### Summary\n`SHCParser` inflates compressed Smart Health Card JWT payloads into memory without a decompressed-size limit. An attacker who can submit SHC content for validation can craft a small compressed JWT payload that expands to a very large byte array, causing memory exhaustion or severe garbage collection pressure.\n\n### Details\nThe vulnerable code is in `org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/SHCParser.java`.\n\n`decodeJWT()` checks `MAX_ALLOWED_SHC_LENGTH`, but this only logs an error and parsing continues:\n\n```java\n// SHCParser.java:282-284\nif (jwt.length() > MAX_ALLOWED_SHC_LENGTH) {\n  logError(...);\n}\n```\n\nIf the header contains `\"zip\":\"DEF\"`, the payload is inflated before JSON parsing:\n\n```java\n// SHCParser.java:300-304\nif (\"DEF\".equals(res.header.asString(\"zip\"))) {\n  payloadJson = inflate(payloadJson);\n}\nres.payload = JsonParser.parseObject(FileUtilities.bytesToString(payloadJson), true);\n```\n\n`inflate()` accumulates all decompressed output in a `ByteArrayOutputStream` and has no maximum output size:\n\n```java\n// SHCParser.java:455-468\nwhile (!inflater.finished()) {\n  final int count = inflater.inflate(buffer);\n  outputStream.write(buffer, 0, count);\n}\nreturn outputStream.toByteArray();\n```\n\nThe same unbounded decompression pattern exists in `decompress()` at `SHCParser.java:410-423`.\n\n### PoC\nCreate a highly compressible SHC-shaped JSON payload, compress it with raw DEFLATE (`new Deflater(9, true)`), Base64URL-encode it as the JWT payload, and set the JWT header to `{\"zip\":\"DEF\"}`.\n\nLocal verification measured the following expansion through `SHCParser.inflate()`:\n\n```text\nplain=1000066 compressed=1052 inflated=1000066 ratio=950\nplain=16000066 compressed=15626 inflated=16000066 ratio=1023\n```\n\nA small compressed payload can therefore allocate many megabytes of heap. Larger payloads can trigger `OutOfMemoryError` or process instability.\n\n### Impact\nThis is a denial-of-service vulnerability. Any validator service or application that accepts attacker-supplied SHC content can be forced to allocate excessive heap memory. Impact ranges from request failure and severe GC pressure to process termination.\n\n### Credits\n- Thai Son Dinh from VinSOC Labs (R&D)","format":"markdown","source":"ghsa"}],"published":"2026-09-16T18:44:47.591Z","modified":"2026-09-30T17:43:24.057Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20","CWE-400","CWE-409"],"affected":[{"ranges":[{"version":"< 6.9.12","status":"affected"}],"vendor":"hapifhir","product":"org.hl7.fhir.core","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.9.12"}],"ecosystem":"Maven","package":"ca.uhn.hapi.fhir:org.hl7.fhir.r5","purl":"pkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.r5","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.9.12"}],"ecosystem":"Maven","package":"ca.uhn.hapi.fhir:org.hl7.fhir.validation","purl":"pkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.validation","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"5.0.0"}],"ecosystem":"Maven","package":"ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli","purl":"pkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.validation.cli","source":"ghsa"}],"references":[{"url":"https://github.com/hapifhir/org.hl7.fhir.core/security/advisories/GHSA-3w98-rrpr-fprr","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapifhir/org.hl7.fhir.core/pull/2493","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapifhir/org.hl7.fhir.core/commit/fbb94216e0ad21ded75be77e5e20242ba194e83f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapifhir/org.hl7.fhir.core/releases/tag/6.9.11","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapifhir/org.hl7.fhir.core/releases/tag/6.9.12","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-81875","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/hapifhir/org.hl7.fhir.core","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-09-17T16:14:08.266Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-81875","url":"https://www.cve.org/CVERecord?id=CVE-2026-81875","licence":"CVE Terms of Use","modified":"2026-09-17T16:14:31.374Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3w98-rrpr-fprr","url":"https://github.com/advisories/GHSA-3w98-rrpr-fprr","licence":"CC-BY-4.0","modified":"2026-09-17T20:45:05.295Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-81875","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-81875","licence":"Public domain","modified":"2026-09-30T17:43:24.057Z"}],"updatedAt":"2026-11-25T22:59:39.099Z","epss":{"score":0.00682,"percentile":0.5374,"date":"2026-12-01T12:00:22.000Z"}}