Security Vulnerability Report
中文
CVE-2026-33745 CVSS 7.4 HIGH

CVE-2026-33745

Published: 2026-03-27 01:16:21
Last Modified: 2026-04-01 14:44:55

Description

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.39.0, the cpp-httplib HTTP client forwards stored Basic Auth, Bearer Token, and Digest Auth credentials to arbitrary hosts when following cross-origin HTTP redirects (301/302/307/308). A malicious or compromised server can redirect the client to an attacker-controlled host, which then receives the plaintext credentials in the `Authorization` header. Version 0.39.0 fixes the issue.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:* - VULNERABLE
cpp-httplib < 0.39.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <httplib.h> #include <iostream> // Simulated vulnerable client behavior void test_vulnerable_redirect() { httplib::Client cli("http://trusted-server.com"); // Set Basic Auth credentials cli.set_basic_auth("user", "secret_password"); // The server responds with a 302 redirect to "http://attacker-controlled.com/log" // In vulnerable versions (< 0.39.0), the Authorization header is forwarded to the attacker. auto res = cli.Get("/redirect-endpoint"); if (res) { std::cout << "Status: " << res->status << std::endl; } else { std::cout << "Request failed" << std::endl; } } // Server side proof (Attacker's server logging the leak) // The attacker captures the 'Authorization' header sent by the vulnerable client.

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33745", "sourceIdentifier": "[email protected]", "published": "2026-03-27T01:16:21.167", "lastModified": "2026-04-01T14:44:55.477", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.39.0, the cpp-httplib HTTP client forwards stored Basic Auth, Bearer Token, and Digest Auth credentials to arbitrary hosts when following cross-origin HTTP redirects (301/302/307/308). A malicious or compromised server can redirect the client to an attacker-controlled host, which then receives the plaintext credentials in the `Authorization` header. Version 0.39.0 fixes the issue."}, {"lang": "es", "value": "cpp-httplib es una biblioteca HTTP/HTTPS multiplataforma de un solo archivo y solo de encabezado C++11. Antes de 0.39.0, el cliente HTTP cpp-httplib reenvía las credenciales almacenadas de Basic Auth, Bearer Token y Digest Auth a hosts arbitrarios al seguir redirecciones HTTP de origen cruzado (301/302/307/308). Un servidor malicioso o comprometido puede redirigir al cliente a un host controlado por el atacante, que luego recibe las credenciales en texto plano en el encabezado 'Authorization'. La versión 0.39.0 corrige el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 7.4, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 5.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 7.4, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-200"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.39.0", "matchCriteriaId": "15F947E0-7142-49B7-B3DF-577C260DFA16"}]}]}], "references": [{"url": "https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-6hrp-7fq9-3qv2", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}