CVE-2026-81875: HAPI FHIR Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-3w98-rrpr-fprr
CVSS 7.5
CWE-409 CWE-400 CWE-20
Published
Advisory Summary

CVE-2026-81875 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting HAPI FHIR libraries in the Maven ecosystem. The issue involves shcparser unbounded deflate decompression causes denial of service. Remediation is available by upgrading affected packages to version 6.9.12.

CVE-2026-81875 at a Glance

CVE Identifier CVE-2026-81875
GHSA Identifier GHSA-3w98-rrpr-fprr
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product HAPI FHIR
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-81875

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

ca.uhn.hapi.fhir:org.hl7.fhir.r5 fixed: 6.9.12
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r5</artifactId>
    <version>6.9.12</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.validation fixed: 6.9.12
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.validation</artifactId>
    <version>6.9.12</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli fixed: Latest secure release
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.validation.cli</artifactId>
    <version>Latest secure release</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=ca.uhn.hapi.fhir

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir

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

Note: The mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir 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-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. In HAPI FHIR, 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 `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. ### Details The vulnerable code is in `org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/SHCParser.java`. `decodeJWT()` checks `MAX_ALLOWED_SHC_LENGTH`, but this only logs an error and parsing continues: ```java // SHCParser.java:282-284 if (jwt.length() > MAX_ALLOWED_SHC_LENGTH) { logError(...); } ``` If the header contains `"zip":"DEF"`, the payload is inflated before JSON parsing: ```java // SHCParser.java:300-304 if ("DEF".equals(res.header.asString("zip"))) { payloadJson = inflate(payloadJson); } res.payload = JsonParser.parseObject(FileUtilities.bytesToString(payloadJson), true); ``` `inflate()` accumulates all decompressed output in a `ByteArrayOutputStream` and has no maximum output size: ```java // SHCParser.java:455-468 while (!inflater.finished()) { final int count = inflater.inflate(buffer); outputStream.write(buffer, 0, count); } return outputStream.toByteArray(); ``` The same unbounded decompression pattern exists in `decompress()` at `SHCParser.java:410-423`. ### PoC Create 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"}`. Local verification measured the following expansion through `SHCParser.inflate()`: ```text plain=1000066 compressed=1052 inflated=1000066 ratio=950 plain=16000066 compressed=15626 inflated=16000066 ratio=1023 ``` A small compressed payload can therefore allocate many megabytes of heap. Larger payloads can trigger `OutOfMemoryError` or process instability. ### Impact This 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. ### Credits - Thai Son Dinh from VinSOC Labs (R&D)

CVE-2026-81875 Affected HAPI FHIR Versions

3 component(s)
Fixed Versions:
6.9.12
Product / Package Ecosystem Affected Versions Fixed Version
ca.uhn.hapi.fhir:org.hl7.fhir.r5
Maven
< 6.9.12
6.9.12
ca.uhn.hapi.fhir:org.hl7.fhir.validation
Maven
< 6.9.12
6.9.12
ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli
Maven
≤ 5.0.0

References

Frequently Asked Questions

What is CVE-2026-81875?
CVE-2026-81875 is a security vulnerability in HAPI FHIR involving SHCParser unbounded DEFLATE decompression causes denial of service under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which HAPI FHIR versions are affected?
Affected versions include releases prior to 6.9.12 across affected packages: ca.uhn.hapi.fhir:org.hl7.fhir.r5, ca.uhn.hapi.fhir:org.hl7.fhir.validation, ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli.
What version fixes CVE-2026-81875?
Upgrading to 6.9.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.hl7.fhir.r5 affected?
Yes, ca.uhn.hapi.fhir:org.hl7.fhir.r5 is affected in releases prior to 6.9.12. Upgrade your dependency to 6.9.12 or later.
Is org.hl7.fhir.validation affected?
Yes, ca.uhn.hapi.fhir:org.hl7.fhir.validation is affected in releases prior to 6.9.12. Upgrade your dependency to 6.9.12 or later.
What is the CVSS score of CVE-2026-81875?
CVE-2026-81875 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-81875?
CVE-2026-81875 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check Maven dependencies for CVE-2026-81875?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir'. 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-3w98-rrpr-fprr",
  "modified" : "2026-09-17T20:32:16Z",
  "published" : "2026-09-17T20:32:16Z",
  "aliases" : [ "CVE-2026-81875" ],
  "summary" : "HAPI FHIR: SHCParser unbounded DEFLATE decompression causes denial of service",
  "details" : "### 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)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.9.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.9.11"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.validation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.9.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.9.11"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "5.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/security/advisories/GHSA-3w98-rrpr-fprr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-81875"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/pull/2493"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/commit/fbb94216e0ad21ded75be77e5e20242ba194e83f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/releases/tag/6.9.11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/releases/tag/6.9.12"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-400", "CWE-409" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-17T20:32:16Z",
    "nvd_published_at" : "2026-09-16T19:17:44Z"
  }
}