Every CVE Search/ Get API key

CVE-2026-34359

HAPI FHIR: Authentication Credential Leakage via Improper URL Prefix Matching on HTTP Redirect in HAPI FHIR Core

7.4 HighFix available

HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.4, ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain. This issue has been patched in version 6.9.4.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
None

Exploit likelihood

0.16%Up 0.1 points since Apr 1, 2026
90%50%10%1%

What each source reports

CVE List Score used 7.4

HAPI FHIR: Authentication Credential Leakage via Improper URL Prefix Matching on HTTP Redirect in HAPI FHIR Core

HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.4, ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain. This issue has been patched in version 6.9.4.

Record
CVE-2026-34359
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-346
Updated
2026-11-02
EUVDEUVD-2026-17524 7.4

HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.4, ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain. This issue has been patched in version 6.9.4.

Record
EUVD-2026-17524
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-fgv2-4q4g-wc35 7.4

HAPI FHIR Core has Authentication Credential Leakage via Improper URL Prefix Matching on HTTP Redirect

Summary

ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain.

Details

The root cause is in ManagedWebAccessUtils.getServer() at org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/http/ManagedWebAccessUtils.java:26:

public static ServerDetailsPOJO getServer(String url, Iterable<ServerDetailsPOJO> serverAuthDetails) {
    if (serverAuthDetails != null) {
      for (ServerDetailsPOJO serverDetails : serverAuthDetails) {
          if (url.startsWith(serverDetails.getUrl())) {  // <-- no host boundary check
            return serverDetails;
          }
      }
    }
    return null;
}

The configured production terminology server URL is defined without a trailing slash in FhirSettingsPOJO.java:19:

protected static final String TX_SERVER_PROD = "http://tx.fhir.org";

This means:

  • "http://tx.fhir.org.attacker.com/capture".startsWith("http://tx.fhir.org") → true
  • "http://tx.fhir.org:8080/evil".startsWith("http://tx.fhir.org") → true

Exploit chain via SimpleHTTPClient (redirect path):

  1. SimpleHTTPClient.get() (SimpleHTTPClient.java:68-105) makes a request to http://tx.fhir.org/ValueSet/$expand
  2. On each redirect, the loop calls getHttpGetConnection(url, accept) (line 84) → setHeaders(connection) (line 117)
  3. setHeaders() (line 122-133) calls authProvider.canProvideHeaders(url) and authProvider.getHeaders(url) on the redirect target URL
  4. ServerDetailsPOJOHTTPAuthProvider.getServerDetails() (line 83-84) delegates to ManagedWebAccessUtils.getServer(url.toString(), servers)
  5. The startsWith() check matches http://tx.fhir.org.attacker.com against http://tx.fhir.org
  6. Credentials are dispatched to the attacker's server via ServerDetailsPOJOHTTPAuthProvider.getHeaders() (lines 38-58):
    • Bearer tokens: Authorization: Bearer {token}
    • Basic auth: Authorization: Basic {base64(user:pass)}
    • API keys: Api-Key: {apikey}
    • Custom headers from server config

Note: An earlier fix (commit 6b615880 "Strip headers on redirect") added an isNotSameHost() check, but this was removed in commit 3871cc69 ("Rework authorization providers in ManagedWebAccess"). The current code on master has no host validation during redirect following.

Exploit chain via ManagedFhirWebAccessor (OkHttp path):

ManagedFhirWebAccessor.httpCall() (line 81-112) sets auth headers via requestWithAuthorizationHeaders() before passing the request to OkHttpClient. OkHttpClient follows redirects by default (up to 20) and carries the pre-set auth headers to all redirect targets. The same startsWith() check in canProvideHeaders() applies.

The same vulnerable pattern also exists in ManagedWebAccess.isLocal() (line 214), where url.startsWith(server.getUrl()) is used to determine whether HTTP (non-TLS) access is allowed, potentially enabling TLS downgrade for attacker-controlled domains that match the prefix.

PoC

Step 1: Verify the prefix match behavior

// This demonstrates the core vulnerability
String configuredUrl = "http://tx.fhir.org";  // FhirSettingsPOJO.TX_SERVER_PROD
String attackerUrl = "http://tx.fhir.org.attacker.com/capture";

System.out.println(attackerUrl.startsWith(configuredUrl));
// Output: true

Step 2: Demonstrate credential dispatch to wrong host

Given a fhir-settings.json configuration at ~/.fhir/fhir-settings.json:

{
  "servers": [
    {
      "url": "http://tx.fhir.org",
      "authenticationType": "token",
      "token": "secret-bearer-token-12345"
    }
  ]
}

…

Record
GHSA-fgv2-4q4g-wc35
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-346
Updated
2026-11-02
NVD 7.4

HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.4, ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain. This issue has been patched in version 6.9.4.

Record
CVE-2026-34359
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-346
Updated
2026-11-02
OSV 7.4

HAPI FHIR: Authentication Credential Leakage via Improper URL Prefix Matching on HTTP Redirect in HAPI FHIR Core

HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to version 6.9.4, ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain. This issue has been patched in version 6.9.4.

Record
CVE-2026-34359
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-346
Updated
2026-11-02
OSVGHSA-fgv2-4q4g-wc35 7.4

HAPI FHIR Core has Authentication Credential Leakage via Improper URL Prefix Matching on HTTP Redirect

Summary

ManagedWebAccessUtils.getServer() uses String.startsWith() to match request URLs against configured server URLs for authentication credential dispatch. Because configured server URLs (e.g., http://tx.fhir.org) lack a trailing slash or host boundary check, an attacker-controlled domain like http://tx.fhir.org.attacker.com matches the prefix and receives Bearer tokens, Basic auth credentials, or API keys when the HTTP client follows a redirect to that domain.

Details

The root cause is in ManagedWebAccessUtils.getServer() at org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/http/ManagedWebAccessUtils.java:26:

public static ServerDetailsPOJO getServer(String url, Iterable<ServerDetailsPOJO> serverAuthDetails) {
    if (serverAuthDetails != null) {
      for (ServerDetailsPOJO serverDetails : serverAuthDetails) {
          if (url.startsWith(serverDetails.getUrl())) {  // <-- no host boundary check
            return serverDetails;
          }
      }
    }
    return null;
}

The configured production terminology server URL is defined without a trailing slash in FhirSettingsPOJO.java:19:

protected static final String TX_SERVER_PROD = "http://tx.fhir.org";

This means:

  • "http://tx.fhir.org.attacker.com/capture".startsWith("http://tx.fhir.org") → true
  • "http://tx.fhir.org:8080/evil".startsWith("http://tx.fhir.org") → true

Exploit chain via SimpleHTTPClient (redirect path):

  1. SimpleHTTPClient.get() (SimpleHTTPClient.java:68-105) makes a request to http://tx.fhir.org/ValueSet/$expand
  2. On each redirect, the loop calls getHttpGetConnection(url, accept) (line 84) → setHeaders(connection) (line 117)
  3. setHeaders() (line 122-133) calls authProvider.canProvideHeaders(url) and authProvider.getHeaders(url) on the redirect target URL
  4. ServerDetailsPOJOHTTPAuthProvider.getServerDetails() (line 83-84) delegates to ManagedWebAccessUtils.getServer(url.toString(), servers)
  5. The startsWith() check matches http://tx.fhir.org.attacker.com against http://tx.fhir.org
  6. Credentials are dispatched to the attacker's server via ServerDetailsPOJOHTTPAuthProvider.getHeaders() (lines 38-58):
    • Bearer tokens: Authorization: Bearer {token}
    • Basic auth: Authorization: Basic {base64(user:pass)}
    • API keys: Api-Key: {apikey}
    • Custom headers from server config

Note: An earlier fix (commit 6b615880 "Strip headers on redirect") added an isNotSameHost() check, but this was removed in commit 3871cc69 ("Rework authorization providers in ManagedWebAccess"). The current code on master has no host validation during redirect following.

Exploit chain via ManagedFhirWebAccessor (OkHttp path):

ManagedFhirWebAccessor.httpCall() (line 81-112) sets auth headers via requestWithAuthorizationHeaders() before passing the request to OkHttpClient. OkHttpClient follows redirects by default (up to 20) and carries the pre-set auth headers to all redirect targets. The same startsWith() check in canProvideHeaders() applies.

The same vulnerable pattern also exists in ManagedWebAccess.isLocal() (line 214), where url.startsWith(server.getUrl()) is used to determine whether HTTP (non-TLS) access is allowed, potentially enabling TLS downgrade for attacker-controlled domains that match the prefix.

PoC

Step 1: Verify the prefix match behavior

// This demonstrates the core vulnerability
String configuredUrl = "http://tx.fhir.org";  // FhirSettingsPOJO.TX_SERVER_PROD
String attackerUrl = "http://tx.fhir.org.attacker.com/capture";

System.out.println(attackerUrl.startsWith(configuredUrl));
// Output: true

Step 2: Demonstrate credential dispatch to wrong host

Given a fhir-settings.json configuration at ~/.fhir/fhir-settings.json:

{
  "servers": [
    {
      "url": "http://tx.fhir.org",
      "authenticationType": "token",
      "token": "secret-bearer-token-12345"
    }
  ]
}

…

Record
GHSA-fgv2-4q4g-wc35
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Weakness
CWE-346
Updated
2026-11-02
OSVROOT-APP-MAVEN-CVE-2026-34359 No score

CVE-2026-34359 in ca.uhn.hapi.fhir:org.hl7.fhir.utilities - Patched by Root

Root has patched CVE-2026-34359 in the ca.uhn.hapi.fhir:org.hl7.fhir.utilities package for Root:Maven. Multiple fixed versions available.

Record
ROOT-APP-MAVEN-CVE-2026-34359
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
ca.uhn.hapi.fhir:org.hl7.fhir.core
Maven
before 6.9.4
6.9.4
ca.uhn.hapi.fhir:org.hl7.fhir.utilities
Maven
before 6.9.4
6.9.4
ca.uhn.hapi.fhir:org.hl7.fhir.core
Maven
before 6.9.4, plus listed versions
0.0.10.0.140.0.20.1.140.1.18
Show 45 moreShow less
1.0.01.1.674.0.04.0.14.0.24.0.34.1.04.2.05.0.05.0.105.0.115.0.125.0.145.0.155.0.165.0.175.0.185.0.195.0.205.0.215.0.225.0.75.0.85.0.95.1.05.1.15.1.105.1.115.1.125.1.135.1.145.1.155.1.165.1.175.1.185.1.195.1.25.1.205.1.215.1.225.1.35.1.45.1.55.1.65.1.7
6.9.4
ca.uhn.hapi.fhir:org.hl7.fhir.utilities
Maven
before 6.9.4, plus listed versions
0.0.10.0.140.0.20.1.181.0.0
Show 45 moreShow less
1.1.674.0.04.0.14.0.24.0.34.1.04.2.05.0.05.0.105.0.115.0.125.0.135.0.145.0.155.0.165.0.175.0.185.0.195.0.205.0.215.0.225.0.75.0.85.0.95.1.05.1.15.1.105.1.115.1.125.1.135.1.145.1.155.1.165.1.175.1.185.1.195.1.25.1.205.1.215.1.225.1.35.1.45.1.55.1.65.1.7
6.9.4
ca.uhn.hapi.fhir:org.hl7.fhir.utilities
Root:Maven
before 6.7.9-aikido.7
6.7.9-aikido.76.9.0-aikido.86.7.9-aikido.66.9.0-aikido.96.7.9-aikido.86.7.9-aikido.106.7.9-aikido.96.9.0-aikido.106.9.0-aikido.116.5.27-aikido.16.4.0-aikido.26.0.1-aikido.26.0.1-aikido.36.0.1-aikido.4
ca.uhn.hapi.fhir:org.hl7.fhir.core
Root:Maven
before 6.7.9-aikido.7
6.7.9-aikido.76.9.0-aikido.86.7.9-aikido.66.9.0-aikido.96.7.9-aikido.86.7.9-aikido.106.7.9-aikido.96.9.0-aikido.106.9.0-aikido.116.5.27-aikido.16.4.0-aikido.2
io.root.ca.uhn.hapi.fhir:org.hl7.fhir.utilities
Root:Maven
before 6.9.0-root.io.3
6.9.0-root.io.36.9.0-root.io.46.7.9-root.io.16.7.9-root.io.26.7.9-root.io.46.9.0-root.io.56.9.0-root.io.66.7.9-root.io.56.9.0-root.io.76.7.9-root.io.76.9.0-root.io.96.9.0-root.io.86.7.9-root.io.66.7.9-root.io.86.7.9-root.io.106.7.9-root.io.96.9.0-root.io.106.9.0-root.io.116.5.27-root.io.16.4.0-root.io.26.0.1-root.io.26.0.1-root.io.36.0.1-root.io.4
io.root.ca.uhn.hapi.fhir:org.hl7.fhir.core
Root:Maven
before 6.9.0-root.io.3
6.9.0-root.io.36.9.0-root.io.46.7.9-root.io.16.7.9-root.io.26.7.9-root.io.46.9.0-root.io.56.9.0-root.io.66.7.9-root.io.56.9.0-root.io.76.7.9-root.io.76.9.0-root.io.86.7.9-root.io.66.9.0-root.io.96.7.9-root.io.86.7.9-root.io.106.7.9-root.io.96.9.0-root.io.106.9.0-root.io.116.5.27-root.io.16.4.0-root.io.2

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-34359 is a high vulnerability (CVSS 7.4) in Hapifhir Hl7 Fhir Core, published March 30, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.16%, the 5th percentile. Fixed in ca.uhn.hapi.fhir:org.hl7.fhir.core 6.9.4.

References

This page doesn't list everything

Left out here: 666 versions and the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open