CRLF Injection Vulnerability in cpp-httplib: Potential for HTTP Response Splitting and XSS

cpp-httplib Updated 02 Oct 2025

Summary

04/02/2025
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2025-0825: cpp-httplib version v0.17.3 through v0.18.3 fails to filter CRLF characters ("\r\n") when those are prefixed with a null byte. Affects cpp-httplib versions < 0.18.7-1. Fixed in 0.18.7-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

cpp-httplib is a lightweight C++ HTTP/HTTPS server and client library designed for ease of use and performance. It allows developers to quickly implement HTTP functionalities in their applications. However, versions v0.17.3 through v0.18.3 are vulnerable to a CRLF injection issue, which can lead to severe security risks.

Vulnerability Detail

The vulnerability arises from cpp-httplib's failure to properly filter CRLF (Carriage Return Line Feed) characters when they are prefixed with a null byte. This oversight allows attackers to exploit CRLF injection, potentially leading to HTTP Response Splitting, Cross-Site Scripting (XSS), and other malicious activities. The affected versions are v0.17.3 to v0.18.3, which can be exploited if the library is used in web applications that process user input without adequate validation.

How To Fix

Minimum fixed version

0.18.7-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade cpp-httplib

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, ensure that all user inputs are properly sanitized and validated before being processed by the cpp-httplib library. This can help mitigate the risk of CRLF injection until the package is updated. For example, you can implement input validation like this: 'if (

input.contains("\r") || input.contains("\n")) { throw new IllegalArgumentException("Invalid input");

}'.

Conclusion

The CRLF injection vulnerability in cpp-httplib poses significant risks to applications using affected versions. It is crucial to update to the patched version 0.18.7-1 or later to ensure the security of your application. Implementing input validation can serve as a temporary measure until the update is applied.

See every vulnerability recorded for cpp-httplib →

Share this vulnerability

FAQ

CRLF injection is a type of attack where an attacker inserts CRLF characters into an HTTP request, potentially altering the structure of the response and leading to security vulnerabilities.

You can use tools like Vulert to monitor and alert for open-source vulnerabilities in your software. By checking your manifest file, you can determine if your application is affected by this vulnerability.

The risks include HTTP Response Splitting, which can lead to XSS attacks, cache poisoning, and other security issues that compromise user data and application integrity.

While the best solution is to update to a patched version, you can implement input validation as a temporary workaround to mitigate the risks associated with this vulnerability.

You can find more information about cpp-httplib on its official GitHub repository, where you can also track updates and security advisories.

Related vulnerabilities

Recent vulnerabilities recorded for cpp-httplib.

How To Fix

Minimum fixed version

0.18.7-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade cpp-httplib

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback