HAPI FHIR CVE-2026-55470
HIGHSeverity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Unauthenticated network-reachable FHIR endpoint evaluates attacker-supplied regex causing CPU exhaustion; availability-only impact, no confidentiality or integrity effect.
Primary rating from Vendor (https://github.com/hapifhir/org.hl7.fhir.core).
CVSS VectorVendor: https://github.com/hapifhir/org.hl7.fhir.core
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Lifecycle Timeline
3Blast Radius
ecosystem impact- 4 maven packages depend on ca.uhn.hapi.fhir:org.hl7.fhir.convertors (4 direct, 0 indirect)
- 5 maven packages depend on ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 (2 direct, 3 indirect)
- 3 maven packages depend on ca.uhn.hapi.fhir:org.hl7.fhir.validation (3 direct, 0 indirect)
Ecosystem-wide dependent count for version 6.9.10 and other introduced versions.
DescriptionCVE.org
Summary
The fix for CVE-2026-45367 added RegexTimeout protection to the matches() function in DSTU2016MAY, DSTU3, R4, R4B, and R5, but the DSTU2 module was incompletely patched. In org.hl7.fhir.dstu2, replaceMatches() was updated while matches() at line 2462 still calls the raw String.matches(sw) without any timeout, allowing an unauthenticated attacker to trigger catastrophic regex backtracking and exhaust server CPU.
Details
Incomplete patch
Within the same file (org.hl7.fhir.dstu2/utils/FHIRPathEngine.java), the two functions were patched inconsistently:
Line 2226 - replaceMatches() - PATCHED:
result.add(new StringType(
RegexTimeout.replaceAll(
convertToString(focus.get(0)), regex, repl, regexTimeoutMillis)));Line 2462 - matches() - NOT PATCHED:
result.add(new BooleanType(
convertToString(focus.get(0)).matches(sw)));
// ↑ raw String.matches() - no RegexTimeout, no complexity checkDSTU3 line 2447 - matches() - PATCHED (for comparison):
result.add(new BooleanType(
RegexTimeout.matches(st, sw, regexTimeoutMillis)));Module-by-module status
| Module | matches() | replaceMatches() |
|---|---|---|
| DSTU2 | ❌ raw str.matches(sw) | ✅ RegexTimeout.replaceAll() |
| DSTU2016MAY | ✅ RegexTimeout.matches() | ✅ |
| DSTU3 | ✅ RegexTimeout.matches() | ✅ |
| R4 | ✅ RegexTimeout.matches() | ✅ |
| R4B | ✅ RegexTimeout.matches() | ✅ |
| R5 | ✅ RegexTimeout.matches() | ✅ |
PoC
Requirements: Java 17+, Maven 3.8+
pom.xml dependencies:
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
<version>6.9.7</version>
</dependency>Test code (reproduces the exact behaviour of DSTU2 line 2462):
import org.hl7.fhir.utilities.regex.RegexTimeout;
import java.util.concurrent.*;
String regex = "((a|b){0,5}){20}";
String input = "a".repeat(25) + "c"; // no match → full backtracking
// ① Patched approach - RegexTimeout terminates at 500 ms
long t1 = System.currentTimeMillis();
try {
RegexTimeout.matches(input, regex, 500);
} catch (TimeoutException e) {
System.out.println("RegexTimeout blocked in " +
(System.currentTimeMillis() - t1) + " ms");
}
// ② DSTU2 line 2462 - raw String.matches(), no timeout
long t2 = System.currentTimeMillis();
input.matches(regex); // equivalent to what FHIRPathEngine does
System.out.println("str.matches() ran for " +
(System.currentTimeMillis() - t2) + " ms with no timeout");Verified output (JDK 25.0.3, Linux):
RegexTimeout blocked in 508 ms ← patched modules: attack stopped
str.matches() ran for 1410 ms ← DSTU2: no timeout, CPU exhaustedThe patched approach cuts off the evaluation at 508 ms. The unpatched DSTU2 code runs for 1410 ms on this input with no mechanism to stop it. Longer inputs or more complex patterns produce proportionally worse results.
Impact
Vulnerability type: Regular Expression Denial of Service (ReDoS) causing CPU exhaustion and service disruption.
Who is impacted: Any application using the ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 module that evaluates user-supplied FHIRPath expressions - including the FHIR Validator HTTP endpoint, FHIR servers applying FHIRPath invariants from user-provided resources or profiles, and any system embedding FHIRPathEngine from the DSTU2 module. No authentication is required; an attacker needs only to submit a FHIR resource or FHIRPath expression whose matches() argument contains a catastrophically backtracking regular expression.
Articles & Coverage 1
AnalysisAI
Regular expression denial of service in HAPI FHIR's DSTU2 FHIRPathEngine allows unauthenticated remote attackers to exhaust server CPU by submitting FHIR resources or FHIRPath expressions containing catastrophically backtracking regexes against the matches() function. This is an incomplete-fix vulnerability stemming from CVE-2026-45367, where the DSTU2 module's matches() at FHIRPathEngine.java line 2462 was left calling raw String.matches() without the RegexTimeout wrapper applied to the other five FHIR version modules. No public exploit identified at time of analysis beyond the reporter's working PoC published in the GHSA advisory.
Technical ContextAI
HAPI FHIR is the reference Java implementation of HL7 FHIR (Fast Healthcare Interoperability Resources), widely deployed in healthcare backends, validation servers, and clinical data pipelines. The FHIRPathEngine evaluates FHIRPath expressions - a query/navigation language used in FHIR invariants, search parameters, and validation rules - where the matches() function tests strings against caller-supplied regular expressions via Java's java.util.regex engine. Because java.util.regex uses an NFA backtracking matcher, evil regex patterns such as ((a|b){0,5}){20} against non-matching input produce exponential backtracking, the textbook CWE-1333 (Inefficient Regular Expression Complexity) scenario. The upstream maintainers had previously introduced a RegexTimeout helper (CVE-2026-45367) that wraps matching in a cancellable task; this fix was applied to DSTU2016MAY, DSTU3, R4, R4B, and R5 but the legacy DSTU2 module's matches() implementation was missed, even though the adjacent replaceMatches() in the same file was updated.
RemediationAI
Vendor-released patch: 6.9.10 - upgrade all four affected Maven artifacts (org.hl7.fhir.dstu2, org.hl7.fhir.convertors, org.hl7.fhir.validation, org.hl7.fhir.validation.cli) from <=6.9.9 to 6.9.10 or later via your dependency manager and rebuild downstream applications including the FHIR Validator CLI and any embedded HAPI services; advisory at https://github.com/hapifhir/org.hl7.fhir.core/security/advisories/GHSA-fxj4-p9xp-37v5. If upgrading immediately is not possible, compensating controls include disabling DSTU2 support entirely if your deployment only needs R4/R4B/R5 (trade-off: breaks any legacy DSTU2 clients), placing the FHIR Validator HTTP endpoint behind authentication and aggressive per-request CPU/time quotas at the reverse proxy or container level (trade-off: legitimate large-resource validations may be cut off), or rejecting inbound FHIRPath expressions and invariants that contain nested quantifiers or alternation patterns indicative of catastrophic backtracking via a WAF rule (trade-off: false positives on legitimate complex profiles).
Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m
Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti
Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent
Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug
JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up
Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up
The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow
Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla
The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during
Same technique Denial Of Service
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
GHSA-fxj4-p9xp-37v5