CachePoisonDetector (CPD-SEC)
A high-concurrency CLI tool for detecting web cache poisoning vulnerabilities.
Overview
CPD-SEC is a security tool designed to identify vulnerabilities in web caching systems that allow cache poisoning attacks.
Installation
Using Pip (Recommended)
You can install CPD-SEC directly from PyPI:
pip install cpd-sec
From Source
-
Clone the repository:
git clone https://github.com/kankburhan/cpd.git cd cpd
-
Install dependencies using Poetry:
poetry installAlternatively, calculate dependencies to requirements.txt and use pip:
pip install .
Usage
CPD-SEC supports multiple input methods and extensive configuration options.
1. Basic Scan (--url)
Scan a single target URL.
# Installed via pip
cpd-sec scan --url https://example.com
# Using poetry
poetry run cpd-sec scan --url https://example.com
2. Pipeline Mode (Stdin)
Pipe URLs from other tools (like waybackurls, gau, subfinder, or cat) directly into CPD-SEC. This is ideal for mass scanning.
# Scan URLs found by waybackurls
waybackurls target.com | cpd-sec scan
# Scan URLs from a file using cat
cat urls.txt | cpd-sec scan --concurrency 20
3. File Input (--file)
Read URLs from a text file (one URL per line).
cpd-sec scan --file urls.txt
4. Raw Request Scan (--request-file)
Scan using a raw HTTP request definition (e.g., copied from Burp Suite).
# Save your request to a file (e.g. request.txt)
cpd-sec scan --request-file request.txt
Alternative: Direct String (--raw)
Use with caution due to shell escaping characters.
cpd-sec scan --raw "GET /api/foo HTTP/1.1
Host: example.com"
5. Advanced Options
Custom Headers (--header)
Add custom headers to every request (e.g., cookies, authorization). You can use this flag multiple times.
cpd-sec scan -u https://admin.example.com \
-h "Cookie: session=12345" \
-h "Authorization: Bearer XYZ"
Output to File (--output)
Save the findings to a JSON or HTML file.
JSON Output:
cpd-sec scan -u https://example.com --output results.json
HTML Report (NEW!): Generate a professional HTML security report with PoC details:
cpd-sec scan -u https://example.com --output report.html
Auto-Open Report (--open):
Automatically open the HTML report in your browser:
cpd-sec scan -u https://example.com --output report.html --open
HTML reports include:
- 🔬 Evidence section with cache headers and variant URLs
- 🎯 Proof-of-Concept URLs ready for manual verification
- 📋 Copy-paste curl commands with malicious headers
- ⚠️ Reflected content sections showing where payloads appear
Concurrency (--concurrency)
Control the number of simultaneous requests (default: 50).
cpd-sec scan -f targets.txt --concurrency 100
Verbosity (--verbose, --quiet)
Control output levels.
cpd-sec scan -u https://example.com -v # Debug logging
cpd-sec scan -u https://example.com -q # Only show findings
5. Utilities
Validate Finding (validate)
Manually verify a vulnerability claim step-by-step.
cpd-sec validate --url https://target.com --header "X-Forwarded-Host: evil.com"
Update Tool (update)
Check for and install the latest version of CPD-SEC.
cpd-sec update
Features
- Auto Update Check: Automatically checks for new versions on run.
- High Concurrency: Built with
asyncioandaiohttpfor speed. - Smart Baseline: Establishes a stable baseline to reduce false positives.
- HTML Security Reports: Professional reports with PoC URLs, curl commands, and evidence details.
- Advanced Poisoning Detection:
- Header Injection:
X-Forwarded-Host,X-Forwarded-Scheme,Fastly-Client-IP, etc. - Path Normalization: Exploits backend URL decoding differences (
/foo\bar). - Query Parameter Normalization: Detects case-insensitive query param cache keys.
- Fat GET: Sends request bodies with GET requests.
- Unkeyed Query Params: Injects parameters to test cache key inclusion.
- Method Override: Tests
X-HTTP-Method-Override. - Cache Key Confusion: Tests URL encoding variants and cache key calculation.
- Next.js Cache Poisoning (CVE-2026): Dedicated detection module for 9 Next.js CVEs:
CVE-2026-44572:x-nextjs-dataredirect cache poisoningCVE-2026-44576: RSC/HTML cache confusionCVE-2026-44582: Weak_rsccache-busting hash collisionCVE-2026-44575: App Router middleware bypass via.rscsuffixCVE-2026-44573: Pages Router i18n data-route bypassCVE-2026-44574:nxtP/nxtIparameter injectionCVE-2026-44579:next-resumeheader injection (cache poisoning + CPDoS)CVE-2026-44581: CSP nonce reflection via cacheCVE-2026-23870: Server-action stream DoS
- Header Injection:
- Pipeline Ready: Designed to integrate into your reconnaissance workflow.
Contributing
We welcome contributions to improve CPD-SEC, especially for new poisoning signatures and false positive reductions.
Reporting False Positives
If you encounter a false positive (a reported vulnerability that is benign), please open an Issue with:
- Replication Output: The output of the
validatecommand:cpd-sec validate --url <TARGET_URL> --header "KEY: VALUE"
- Context: Why you believe it is benign (e.g., "The server normalizes the path but returns the same content").
Contributing Code
- Fork the repository.
- Clone your fork locally.
- Install dependencies:
poetry install. - Create a Branch for your feature/fix.
- Add/Modify Signatures in
cpd/logic/poison.py. - Add Tests in
tests/to verify your changes. - Submit a Pull Request!
Support & Donations
If CPD-SEC helped you find vulnerabilities and improve security, consider supporting its development!
💳 PayPal:
paypal.me/kankburhan
💰 Crypto (USDC):
0x4618393bf4ddc50eb3e75df849b46aca0d0f8e3c
Your support helps maintain and improve this open-source security tool. Thank you! 🙏
License
MIT License - see LICENSE file for details.
Metadata
Release files for cpd-sec 0.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cpd_sec-0.11.1.tar.gz | 82.7 kB | Without provenance | Details for cpd_sec-0.11.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cpd_sec-0.11.1-py3-none-any.whl | Python 3 | none | any | Details for cpd_sec-0.11.1-py3-none-any.whl |
Total release size: 178.5 kB
Release files / cpd_sec-0.11.1.tar.gz
| Download URL | cpd_sec-0.11.1.tar.gz |
|---|---|
| Size | 82.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
786a237fd1551585ecd448c71adc7e4ea7b88ab85830253fc8b0f5f0b8668860
|
|
BLAKE2b-256 checksum How to use checksums |
baa951a5f5489318b97769d19f18c5ee7c1ef339e93ebff9ac6b0443677cca66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.9.25 Linux/6.17.0-1020-azure
|
Release files / cpd_sec-0.11.1-py3-none-any.whl
| Download URL | cpd_sec-0.11.1-py3-none-any.whl |
|---|---|
| Size | 95.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
daf2d43981e2ffebfaf0fb806792f3407c1355d89984d9217214d39f1e364c74
|
|
BLAKE2b-256 checksum How to use checksums |
a72c170c099632f49bbd91dd9766ad0c859f87b7de4fe51da2c7f08fa1a33431
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.9.25 Linux/6.17.0-1020-azure
|
Security for cpd-sec 0.11.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.