/

CVE-2026-81876

Severity:

HIGH RISK

(7.5)

Infinite Loop (CWE-835) in HAPI FHIR Java SHCParser

CVE-2026-81876

Awaiting Analysis

Vulnerability type

Category:

Uncontrolled Resource Consumption

CWE:

CWE-20, CWE-400, CWE-835

Impact:

Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

HAPI FHIR's SHCParser can enter an infinite loop while processing malformed Smart Health Card JWT content that uses raw-DEFLATE compression. An attacker who can submit such content may cause a JVM worker thread to remain occupied, potentially exhausting validation workers and creating a denial-of-service condition.

Affected context

The issue may affect HAPI FHIR deployments that parse Smart Health Card JWTs and accept attacker-controlled compressed or partially compressed content. The vulnerable parsing path can also be reached during file-format detection, so malformed input may trigger the behavior before normal validation completes. Risk is greater in services that process requests using a finite pool of JVM worker threads.

Exploit preconditions

  • Attack surface: Smart Health Card JWT or related resource-validation input - Required access: Ability to submit or cause processing of attacker-controlled

token content

  • Trigger point: DEFLATE decompression performed by SHCParser during JWT

decoding or resource format detection

  • Why exploitation is possible: A decompression loop does not terminate when

the inflater makes no progress, requires more input, or requires a preset

dictionary, allowing a malformed stream to keep a worker thread busy

Why this happens

The underlying bug is an uncontrolled loop in decompression handling. The parser repeatedly calls the inflater without treating zero progress, missing input, or dictionary requirements as terminal conditions. This behavior maps to CWE-835, Infinite Loop, and is also related to CWE-400 because a malformed input can consume a worker indefinitely. Insufficient validation of compressed input is additionally consistent with CWE-20.

Potential impact

  • A malformed request may pin a JVM worker thread indefinitely
  • Concurrent requests could exhaust validation worker capacity
  • The service may become slow, unavailable, or unable to process legitimate requests
  • Dependent interoperability or clinical workflow services could experience delays

General mitigation guidance

Mitigation generally focuses on making decompression loops progress-aware and bounded. Secure parser designs should terminate when decompression reports zero progress, needs additional input, has completed, or requires a dictionary that is not available. Compressed input should be subject to explicit size, expansion, time, and processing limits before and during parsing. Validation should reject malformed or truncated content early, and worker pools should use resource isolation, bounded queues, and least privilege so that parser failures do not consume all service capacity. Deployments should use a vendor-maintained corrected implementation through their normal dependency-management process.

How teams detect issues like this

Static analysis can look for decompression loops that omit checks for zero-progress results, end-of-stream state, required dictionaries, or unavailable input. Code review should examine all wrappers around inflater APIs, including shared helpers and format-detection paths, for bounded termination and resource limits. Dynamic testing should include empty, truncated, dictionary-dependent, and malformed compressed streams while monitoring thread occupancy and request latency. Runtime policies can enforce request-size, decompression, timeout, and worker-utilization thresholds. Automated security review tools may help identify suspicious loop and decompression patterns.

Sources

SourceLink
github.comgithub.com/hapifhir/org.hl7.fhir.core/commit/d804558bd77372b1629e55a5b901cad3f5134cdc
github.comgithub.com/hapifhir/org.hl7.fhir.core/commit/edd5d8c139e669e39270785f08be7b63aefef24c
github.comgithub.com/hapifhir/org.hl7.fhir.core/pull/2493
github.comgithub.com/hapifhir/org.hl7.fhir.core/security/advisories/GHSA-gq9c-wmrm-5hvr

Frequently asked

questions

It can be remotely exploitable when a service accepts attacker-controlled

Smart Health Card JWT or validation content over a network interface.

The attacker generally needs only the ability to submit content to an exposed

validation or parsing endpoint. Administrative access is not inherently

required, although deployment-specific authentication and authorization may

limit exposure.

Use decompression logic with explicit termination checks for completion,

missing input, required dictionaries, and zero progress. Combine this with

bounded input, expansion, time, and worker-resource limits.

Treat compressed tokens as untrusted input, test malformed and truncated

streams, review all parser entry points, and monitor worker exhaustion and

decompression latency in production.

Find out what's already
exploitable in your codebase.