CVE-2026-55470: HAPI FHIR: DSTU2 FHIRPathEngine.matches() missing RegexTimeout protection allows ReDoS

Published Jun 17, 2026
·
Updated

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

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

Other sources

HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to 6.9.10, the fix for CVE-2026-45367 incompletely patched the DSTU2 module, leaving FHIRPathEngine.matches() in org.hl7.fhir.dstu2/utils/FHIRPathEngine.java to call raw String.matches(sw) without RegexTimeout protection while replaceMatches() was updated, allowing an unauthenticated attacker to trigger catastrophic regex backtracking and exhaust server CPU. This issue is fixed in version 6.9.10.

MITRE

Affected Software

5 affected componentsFixes available
maven/ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli<=6.9.9
6.9.10
maven/ca.uhn.hapi.fhir:org.hl7.fhir.validation<=6.9.9
6.9.10
maven/ca.uhn.hapi.fhir:org.hl7.fhir.convertors<=6.9.9
6.9.10
maven/ca.uhn.hapi.fhir:org.hl7.fhir.dstu2<=6.9.9
6.9.10
hapifhir Hl7 Fhir Core<6.9.10

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli to a version that resolves this vulnerability.

    Fixed in 6.9.10
  2. Upgrade

    Upgrade maven/ca.uhn.hapi.fhir:org.hl7.fhir.validation to a version that resolves this vulnerability.

    Fixed in 6.9.10
  3. Upgrade

    Upgrade maven/ca.uhn.hapi.fhir:org.hl7.fhir.convertors to a version that resolves this vulnerability.

    Fixed in 6.9.10
  4. Upgrade

    Upgrade maven/ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 to a version that resolves this vulnerability.

    Fixed in 6.9.10
  5. Upgrade

    Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 to a version that resolves this vulnerability.

    Fixed in 6.9.10Patch CVE-2026-45367

Event History

Jun 17, 2026
Advisory Published
via GitHub·06:47 PM
Data Sourced
via GitHub·06:47 PM
DescriptionSeverityWeaknessAffected Software
Jul 8, 2026
CVE Published
via MITRE·09:27 PM
Data Sourced
via MITRE·09:27 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-55470?

CVE-2026-55470 has a severity rating of high, with a score of 7.5.

2

How do I fix CVE-2026-55470?

To fix CVE-2026-55470, update the `matches()` function in the DSTU2 module to ensure proper `RegexTimeout` protection is implemented.

3

What impact does CVE-2026-55470 have on my system?

CVE-2026-55470 poses a risk of denial of service due to an incomplete patch in the matches() function.

4

Which software is affected by CVE-2026-55470?

CVE-2026-55470 affects the maven packages including ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli and org.hl7.fhir.dstu2.

5

When was CVE-2026-55470 published?

CVE-2026-55470 was published on June 17, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203