Skip to main content

HAPI FHIR CVE-2026-55470

HIGH
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2026-06-17 https://github.com/hapifhir/org.hl7.fhir.core GHSA-fxj4-p9xp-37v5
7.5
CVSS 3.1 · Vendor: https://github.com/hapifhir/org.hl7.fhir.core
Share

Severity by source

Vendor (https://github.com/hapifhir/org.hl7.fhir.core) PRIMARY
7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI
7.5 HIGH

Unauthenticated network-reachable FHIR endpoint evaluates attacker-supplied regex causing CPU exhaustion; availability-only impact, no confidentiality or integrity effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat
7.5 HIGH
qualitative

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
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

3
Source Code Evidence Fetched
Jun 18, 2026 - 01:39 vuln.today
Analysis Generated
Jun 18, 2026 - 01:39 vuln.today
CVE Published
Jun 17, 2026 - 18:47 github-advisory
HIGH 7.5

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 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:

java
result.add(new StringType(
    RegexTimeout.replaceAll(
        convertToString(focus.get(0)), regex, repl, regexTimeoutMillis)));

Line 2462 - matches() - NOT PATCHED:

java
result.add(new BooleanType(
    convertToString(focus.get(0)).matches(sw)));
// ↑ raw String.matches() - no RegexTimeout, no complexity check

DSTU3 line 2447 - matches() - PATCHED (for comparison):

java
result.add(new BooleanType(
    RegexTimeout.matches(st, sw, regexTimeoutMillis)));

Module-by-module status

Modulematches()replaceMatches()
DSTU2❌ raw str.matches(sw)RegexTimeout.replaceAll()
DSTU2016MAYRegexTimeout.matches()
DSTU3RegexTimeout.matches()
R4RegexTimeout.matches()
R4BRegexTimeout.matches()
R5RegexTimeout.matches()

PoC

Requirements: Java 17+, Maven 3.8+

pom.xml dependencies:

xml
<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):

java
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 exhausted

The 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.

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).

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

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

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

Share

CVE-2026-55470 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy