CVE-2025-66570
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedcpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.27.0, a vulnerability allows attacker-controlled HTTP headers to influence server-visible metadata, logging, and authorization decisions. An attacker can inject headers named REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, LOCAL_PORT that are parsed into the request header multimap via read_headers() in httplib.h (headers.emplace), then the server later appends its own internal metadata using the same header names in Server::process_request without erasing duplicates. Because Request::get_header_value returns the first entry for a header key (id == 0) and the client-supplied headers are parsed before server-inserted headers, downstream code that uses these header names may inadvertently use attacker-controlled values. Affected files/locations: cpp-httplib/httplib.h (read_headers, Server::process_request, Request::get_header_value, get_header_value_u64) and cpp-httplib/docker/main.cc (get_client_ip, nginx_access_logger, nginx_error_logger). Attack surface: attacker-controlled HTTP headers in incoming requests flow into the Request.headers multimap and into logging code that reads forwarded headers, enabling IP spoofing, log poisoning, and authorization bypass via header shadowing. This vulnerability is fixed in 0.27.0.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceIn cpp-httplib prior to 0.27.0, an attacker can inject HTTP headers named REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, or LOCAL_PORT into requests. Since client-supplied headers are parsed before server-inserted metadata and Request::get_header_value returns the first matching header, downstream code that reads these headers receives attacker-controlled values instead of genuine server-calculated values.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 0.27.0CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify cpp-httplib version in useSearch for the httplib.h header file in your project dependencies or installed libraries. Open the file and locate the version definition near the top (often in a macro like CPPHTTPLIB_VERSION or similar). Alternatively, check your package manager or dependency lock file for the cpp-httplib version pinned.Affected if The version is prior to 0.27.0 (e.g., 0.26.x, 0.25.x, etc.)
-
Find code that reads REMOTE_ADDR or REMOTE_PORT headersSearch your codebase for calls to Request::get_header_value or similar methods using the string literals "REMOTE_ADDR", "REMOTE_PORT", "LOCAL_ADDR", or "LOCAL_PORT" as the header name argument.Affected if Code exists that retrieves these header names via get_header_value or equivalent and uses the returned values for IP logging, access control, or authentication decisions.
-
Verify header processing orderExamine the httplib implementation of get_header_value to confirm it returns the first matching entry from the Request.headers multimap. In affected versions, client-supplied headers are inserted before server-computed headers.Affected if The implementation returns the first match, and the application relies on server-computed values that are stored later in the multimap.
-
Check if server-computed headers are setLocate where the server populates REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, and LOCAL_PORT headers (if at all). These are typically set by the server after reading the actual network connection details.Affected if The server sets these headers after parsing the request, meaning client-injected headers with the same name would appear first in the multimap.
You are affected if your application uses cpp-httplib versions prior to 0.27.0 AND processes the headers REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, or LOCAL_PORT via get_header_value for security-critical operations.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped0.27.0
Upgrade cpp-httplib to version 0.27.0 or later, then audit all code paths that read REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, or LOCAL_PORT headers to verify correct behavior after the fix.
0.27.0
- Download httplib.h version 0.27.0 from the official releases (https://github.com/yhirose/cpp-httplib/releases/tag/v0.27.0) or the GitHub releases page
- Replace the existing cpp-httplib/httplib.h file in your project with the new version 0.27.0
- If using a package manager (conan, vcpkg, CPM.cmake, or git submodule), update the dependency specification to require version 0.27.0 or later
- Rebuild your project to ensure the new library version is compiled
- Verify the fix by testing that attacker-controlled REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, and LOCAL_PORT headers can no longer override server-inserted metadata
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation2.0 h
- Testing6.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,160.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-66570 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-66570 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data