CVE-2026-45367

CVE-2026-45367 is a high-severity inefficient regular expression (ReDoS) vulnerability in ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 (maven), affecting versions <= 6.9.6. It is fixed in 6.9.7.

Check whether CVE-2026-45367 affects your applications

Kodem tells you whether this CVE is present, reachable, and actually executing in your application, so you know if it matters.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence. Only the CVEs that actually run in production.

Summary

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

Full technical description

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

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

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

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.

A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use. Typical impact: denial of service when input is crafted to trigger backtracking.

CVE-2026-45367 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (6.9.7); upgrading removes the vulnerable code path.

Affected versions

ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.r4 (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.r4b (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.r5 (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.validation (<= 6.9.6) ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli (<= 6.9.6)

Security releases

ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.r4 → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.r4b → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.r5 → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.validation → 6.9.7 (maven) ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli → 6.9.7 (maven)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade the following packages to resolve this vulnerability:

ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.r4 to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.r4b to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.r5 to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.validation to 6.9.7 or later; ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli to 6.9.7 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-45367? CVE-2026-45367 is a high-severity inefficient regular expression (ReDoS) vulnerability in ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 (maven), affecting versions <= 6.9.6. It is fixed in 6.9.7. A regular expression with worst-case exponential or polynomial matching time is applied to untrusted input, causing excessive CPU use.
  2. How severe is CVE-2026-45367? CVE-2026-45367 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2026-45367?
    • ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.r4 (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.r4b (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.r5 (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.validation (maven) (versions <= 6.9.6)
    • ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli (maven) (versions <= 6.9.6)
  4. Is there a fix for CVE-2026-45367? Yes. CVE-2026-45367 is fixed in 6.9.7. Upgrade to this version or later.
  5. Is CVE-2026-45367 exploitable, and should I be worried? Whether CVE-2026-45367 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-45367 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-45367?
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.r4 to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.r4b to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.r5 to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.validation to 6.9.7 or later
    • Upgrade ca.uhn.hapi.fhir:org.hl7.fhir.validation.cli to 6.9.7 or later

Other vulnerabilities in ca.uhn.hapi.fhir:org.hl7.fhir.dstu2

Stop the waste.
Protect your environment with Kodem.