Loading...
Skip to main content

CVE-2026-45367 — Vulnerability in...

HIGH

HAPI FHIR: ReDoS via FHIRPath matches()/replaceMatches() in FHIR Validator HTTP Endpoint

Published May 18, 2026Updated September 10, 2026Source: osv

Summary

## Summary All implementations of FHIRPathEngine accept arbitrary FHIRPath expressions and evaluate them without input validation. The FHIRPath functions `matches()`, `matchesFull()`, and `replaceMatches()` pass user-controlled regular expressions directly to Java's `Pattern.compile()` and `String.replaceAll()` without complexity checks or timeouts. An attacker can send a resource containing an evil regex pattern that causes catastrophic backtracking, exhausting system resources, and causing Denial-of-Service. ## Details The vulnerability exists in regex execution in FHIRPathEngine implementations across multiple code modules. For example the org.hl7.fhir.r5 module: **Entry point 1 — `FHIRPathEngine.java:5929` (R5 `funcMatches`):** ```java private List<Base> funcMatches(ExecutionContext context, List<Base> focus, ExpressionNode exp) { String sw = convertToString(swb); // attacker-controlled regex pattern // ... Pattern p = Pattern.compile("(?s)" + sw); // VULNERABLE: no complexity check Matcher m = p.matcher(st); // no timeout boolean ok = m.find(); ``` **Entry point 2 — `FHIRPathEngine.java:5951` (R5 `funcMatchesFull`):** ```java Pattern p = Pattern.compile("(?s)" + sw); // VULNERABLE: same pattern Matcher m = p.matcher(st); boolean ok = m.matches(); ``` **Entry point 3 — `FHIRPathEngine.java:5120` (R5 `funcReplaceMatches`):** ```java result.add(new StringType(convertToString(focus.get(0)) .replaceAll(regex, repl)).noExtensions()); // VULNERABLE: replaceAll uses Pattern internally ``` The same vulnerabilities exist in the dstu2, dstu2016may, dstu3, r4, and r4b modules, and the FHIRPathEngine is used in the validation module functionality. **Why this is exploitable:** - No timeout mechanism covers FHIRPath evaluation — the `ValidationTimeout` class only protects `InstanceValidator` operations, not `evaluateFhirPath()` - Java's `Pattern.compile()` with a pattern like `(a+)+$` against input `"aaaaaaaaaaaaaaaaaaaaaa!"` causes exponential backtracking (O(2^n) time complexity) ## Impact - **CPU Exhaustion:** The exponential backtracking in Java's regex engine consumes 100% of a CPU core for the duration of the hang (effectively infinite for sufficiently long input strings) for callers of FHIRPathEngine.

Advisory Timeline

  • First published May 18, 2026 (147 days ago).
  • Last revised September 10, 2026 — 114 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.r4 to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.r4 -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.r5 to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.r5 -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.r4b to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.r4b -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.validation to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.validation -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli -->
Maven
Update ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 to 6.9.7 or later
<!-- Update pom.xml dependency version to 6.9.7 for ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 -->

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (8)

Affects 1 ecosystem: maven (8).

PackageEcosystemAffectedFixed In
ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may
maven
0.0.1, 0.0.14, 0.0.2, 0.1.18 (+384 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.r4
maven
0.0.1, 0.0.14, 0.0.2, 0.1.18 (+384 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.dstu2
maven
0.0.1, 0.0.14, 0.0.2, 0.1.18 (+384 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.r5
maven
0.0.1, 0.0.14, 0.0.2, 0.1.18 (+384 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.r4b
maven
5.6.100, 5.6.101, 5.6.102, 5.6.103 (+257 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.validation
maven
0.0.1, 0.0.14, 0.0.2, 0.1.18 (+384 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli
maven
4.0.0, 4.0.1, 4.0.2, 4.0.3 (+3 more)6.9.7
ca.uhn.hapi.fhir:org.hl7.fhir.dstu3
maven
0.0.1, 0.0.14, 0.0.2, 0.1.18 (+384 more)6.9.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2026-45367?
HAPI FHIR: ReDoS via FHIRPath matches()/replaceMatches() in FHIR Validator HTTP Endpoint This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2026-45367?
CVE-2026-45367 affects ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may, ca.uhn.hapi.fhir:org.hl7.fhir.r4 and ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 (and 5 more). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-45367 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-3653-68v6-rq57

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies