Sec-88
  • 🧑Whoami
  • 🕸️Web-AppSec
    • Features Abuse
      • 2FA
      • Ban Feature
      • CAPTCHA
      • Commenting
      • Contact us
      • File-Upload
      • Inviting Feature
      • Messaging Features
      • Money-Related Features
      • Newsletter
      • Profile - Settings
      • Registration
      • Reset Password
      • Review
      • Rich Editor/Text
      • Social Sharing
      • Billing-Shipping Address Management
      • Integrations - Webhooks
      • API Key Management
    • Reconnaissance
      • Attacking Organizations with big scopes
    • Subdomain Enumeration
    • Fingerprinting
    • Dorking
    • XSS-HTML Injection
    • Improper Authentication
      • JWT Security
    • OAUTH Misconfigurations
      • OAuth 2.0 Basics
      • OAUTH Misconfigurations
    • Auth0 Misconfigurations
    • Broken Access Control
      • Insecure Direct Object References (IDOR)
      • 403 Bypass
    • Broken Link Injection
    • Command Injection
    • CORS
    • CRLF
    • CSRF
    • Host Header Attacks
    • HTTP request smuggling
    • JSON Request Testing
    • LFI
      • LFI to RCE
    • No Rate Limit
    • Parameters Manual Testing
    • Open Redirect
    • Registration & Takeover Bugs
    • Remote Code Execution (RCE)
    • Session Fixation
    • SQL Injection
      • SQL To RCE
    • SSRF
    • SSTI
    • Subdomain Takeover
    • Web Caching Vulnerabilities
    • WebSockets
    • XXE
      • XXE to RCE
    • Cookie Based Attacks
    • CMS
      • AEM [Adobe CMS]
    • XSSI (Cross Site Script Inclusion)
    • NoSQL injection
    • Local VS Remote Session Fixation
    • Protection
      • Security Mechanisms for Websites
      • Cookie Flags
      • SameSite Cookie Restrictions
      • Same-origin policy (SOP)
      • CSP
    • Hacking IIS Applications
    • Dependency Confusion
    • Attacking Secondary Context
    • Hacking Web Sockets
    • IDN Homograph Attack
    • DNS Rebinding Attack
    • LLM Hacking Checklist
    • Bypass URL Filtration
    • Cross-Site Path Traversal (CSPT)
    • PostMessage Security
    • Prototype Pollution
      • Client-Side Prototype Pollution
      • Server-Side prototype pollution
    • Tools-Extensions-Bookmarks
    • WAF Bypassing Techniques
    • SSL/TLS Certificate Lifecycle
    • Serialization in .NET
    • Client-Side Attacks
      • JavaScript Analysis
    • Bug Bounty Platforms/Programs
  • ✉️API-Sec
    • GraphQL API Security Testing
      • The Basics
      • GraphQL Communication
      • Setting Up a Vulnerable GraphQL Server
      • GraphQL Hacking Tools
      • GraphQL Attack Surface
      • RECONNAISSANCE
      • GraphQL DOS
      • Information Disclosure
      • AUTHENTICATION AND AUTHORIZATION BYPASSES
      • Injection Vulnerabilities in GraphQL
      • REQUEST FORGERY AND HIJACKING
      • VULNERABILITIES, REPORTS AND EXPLOITS
      • GraphQL Hacking Checklist
    • API Recon
    • API Token Attacks
    • Broken Object Level Authorization (BOLA)
    • Broken Authentication
    • Evasive Maneuvers
    • Improper Assets Management
    • Mass Assignment Attacks
    • SSRF
    • Injection Vulnerabilities
    • Excessive Data Exposure
    • OWASP API TOP 10 MindMap
    • Scanning APIs with OWASP ZAP
  • 📱Android-AppSec
    • Setup Android App Pentesting environment on Arch
    • Setup Android App Pentesting environment on Mac M4
    • Setup Android Pentesting Environment on Debian Linux
    • Android App Fundamentals
      • Android Architecture
      • Android Security Model
      • Android App Components
        • Intents
        • Pending Intents
    • Android App Components Security Cheatsheet
    • Android App Pentesting Checklist
    • How To Get APK file for application
    • ADB Commands
    • APK structure
    • Android Permissions
    • Exported Activity Hacking
    • BroadcastReceiver Hacking
    • Content Provider Hacking
    • Signing the APK
    • Reverse Engineering APK
    • Deep Links Hacking
    • Drozer Cheat Sheet
    • SMALI
      • SMALI Cheat Sheet
      • Smali Code Patching Guide
    • Intent Redirection Vulnerability
    • Janus Vulnerability (CVE-2017-13156)
    • Task Hijacking
    • Hacking Labs
      • Injured Android
      • Hacking the VulnWebView Lab
      • Hacking InsecureBankv2 App
    • Frida Cheat Sheet
  • 📶Network-Sec
    • Networking Fundamentals
    • Open Ports Security Testing
    • Vulnerability Scanning
    • Client Side Attacks
    • Port Redirection and Tunneling
    • Password Attacks
    • Privilege Escalation [PrevEsc]
      • Linux Privilege Escalation
    • Buffer Overflow (BOF)
      • VulnServer
      • Sync Breez Enterprize
      • Crashed CTF
      • BOF for Linux
    • AV Evasion
    • Post Exploitation
      • File Transfer
      • Maintaining Access
      • Pivoting
      • Clean Up
    • Active Directory
      • Basic AD Pentesting
  • 💻Desktop AppSec
    • Thin Client vs. Thick Client
  • ☁️Cloud Sec
    • Salesforce Hacking
      • Basics
      • Salesforce SAAS Apps Hacking
    • Firebase
    • S3 Buckets Misconfigurations
  • 👨‍💻Programming
    • HTML
    • JavaScript (JS)
      • window.location object
    • Python
      • Python Tips
      • Set
        • SetMethods
    • JAVA
      • Java Essentials
      • Java Essentials Code Notes
      • Java OOP1
      • JAVA OOP Principles
        • Inheritance
        • Method Overriding
        • Abstract Class
        • Interface
        • polymorphism
        • Encapsulation
        • Composition
      • Java OOP Challenges
      • Exception Handling
    • Go
      • Go Syntax Tutorial in one file
      • Methods and Interfaces
      • Go Slices
      • Go Maps
      • Go Functions
      • Concurrency
      • Read Files
      • Write Files
      • Package
        • How to make personal Package
        • regexp Packages
        • Json
        • bufio
        • Time
      • Signals-Exit
      • Unit Testing
  • 🖥️Operating Systems
    • Linux
      • Linux Commands
      • Tools
      • Linux File System
      • Bash Scripting guide
      • tmux
      • Git
      • Install Go tools from private repositories using GitHub PAT
    • VPS
    • Burp Suite
  • ✍️Write-Ups
    • Hunting Methodology
    • API BAC leads to PII Data Disclosure
    • Misconfigured OATUH leads to Pre-Account Takeover
    • Automating Bug Bounty with GitHub Actions
    • From Recon to Reward: My Bug Bounty Methodology when Hunting on Public Bug Bounty Programs
    • Exploring Subdomains: From Enumeration to Takeover Victory
    • 0-Click Account Takeover via Insecure Password Reset Feature
    • How a Simple Click Can Lead to Account Takeover: An OAuth Insecure Implementation Vulnerability
    • The Power Of IDOR even if it is unpredictable IDs
    • Unlocking the Weak Spot: Exploiting Insecure Password Reset Tokens
    • AI Under Siege: Discovering and Exploiting Vulnerabilities
    • Inside the Classroom: How We Hacked Our Way Past Authorization on a Leading EdTech Platform
    • How We Secured Our Client’s Platform Against Interaction-Free Account Thefts
    • Unchecked Privileges: The Hidden Risk of Role Escalation in Collaborative Platforms
    • Decoding Server Behavior: The Key to Mass Account Takeover
    • Exploiting JSON-Based CSRF: The Hidden Threat in Profile Management
    • How We Turned a Medium XSS into a High Bounty by Bypassing HttpOnly Cookie
Powered by GitBook
On this page
  • Intro
  • key Concepts
  • Caching flow
  • If cache key not exist
  • If Exist
  • Cache Keys in common CDNs
  • Testing Web Cache Vulnerabilities:
  • Tools & Extension:
  • The difference
  • Resources AND Practice Labs
  • Top Web Cache reports from HackerOne:

Was this helpful?

Edit on GitHub
  1. Web-AppSec

Web Caching Vulnerabilities

CWE-524: Use of Cache Containing Sensitive Information

PreviousSubdomain TakeoverNextWebSockets

Last updated 8 months ago

Was this helpful?

Intro

Web caching is a technique used to improve the performance and efficiency of websites by storing copies of frequently accessed content closer to the user. Instead of generating the same content repeatedly, cache servers store this content and deliver it directly to users upon subsequent requests. This reduces the load on the web server, decreases response times, and conserves bandwidth. Caching can occur at various levels, such as within a Content Delivery Network (CDN), in a browser, or at an intermediary proxy.

However, if caching is misconfigured or vulnerable, attackers can exploit it to manipulate cached content, bypass security policies, or cause sensitive information to be stored and served to unintended users. This introduces a range of security risks known as web cache vulnerabilities. Understanding how caching works is essential to identifying and mitigating these vulnerabilities.

key Concepts

  • Cache Buster: Technique to force the cache server to load the latest version from the web server.

  • Cache Key: A unique identifier for cached responses, created from request parameters.

  • Web Server: Back-end (application framework).

  • Cache Server: Front-end (e.g., CDN like Akamai, Cloudflare).

Caching flow

If cache key not exist

If Exist

Cache Keys in common CDNs

Cache Key : unique identifier for a request in the cache server e.g.

  • Akamai

  • Cloudflare

Testing Web Cache Vulnerabilities:

  1. Cache Key Variation: Ensure each request has a different cache key by analyzing cache-related headers (e.g., Age, X-Cache, Cf-Cache-Status).

  2. Cacheable Responses: Investigate if the response is cacheable based on user input, CSRF tokens, or query parameters.

    • Tools: Burp Suite with Reshaper extension for identifying cacheable responses.

  3. Header Fuzzing:

    • Test headers with different cases, variations (X-Forwarded-Host, X_Forwarded_Host, etc.), and multiple headers to find unkeyed headers that might result in cache poisoning.

    • Headers like X-Forwarded-Host can sometimes be unkeyed, leading to vulnerabilities like stored XSS or open redirection.

**Bypasses

X-Forwarded-Host
X-FORWARDED-HOST
x-forwarded-host
X_Forwarded_Host
X-Forwarded-Host :

//  Double Header
X-Forwarded-Host
X-Forwarded-Host
  1. Query Parameter Fuzzing:Focus on unkeyed query parameters (e.g., utm_.*, _method) that the cache server ignores but the web server processes, leading to potential XSS, DoS, or information leakage.

  2. FatGet: Handling GET method with a body

  3. Cache Key Normalization: Handling unencoding of special characters

  4. Path Traversal: Test for path traversal (../, ..%2F, etc.) to manipulate cache paths and cache sensitive responses.

    ⚠️ Static Cache Response OR Dynamic Cache Response !

    Some web administrator configure CDNs to cache e.g. path/* so we can use this to cache something not cacheable e.g. user info OR self-XSS

  5. Self Bugs + Senseetive response -> Cache Deception

    .js->file.js-> /.js-> /file.js->.css

  6. Special Characters and Delimiters:

    user\xFUZZ
    user\xFUZZ.js
    user%FUZZ
    user%FUZZ.js
    user%25%FUZZ
    user%25%FUZZ.js
    user%25%25%FUZZ
    user%25%25%FUZZ.js
    user%FUZZ%FUZZ
    user%FUZZ%FUZZ.js
    • Delimiter: Specify boundaries between different elements in URLs e.g. ; OR %00 OR %0d OR %0a OR %09 etc

    • Use delimiters like ;, %00, %0d to exploit discrepancies between how cache and origin servers parse requests, leading to cache poisoning.

    • Discrepancies in how the cache and origin server use characters and strings as delimiters can result in cache deception .

  7. Delimiter discrepancies lead to cache deception: if there is a delimiter I can trick a cache server to cache uncacheable response .

  8. Chain Delimiter discrepancies AND Path traversal -> Cache Deception

  9. Testing for DoS: Exploit cache poisoning for DoS by forcing the cache to serve incorrect or error responses, such as caching empty responses or invalid status codes.

Tools & Extension:

  • Randomizer: For generating random tokens in requests to help as a cache buster.

    • Burp session configurations

  • Burpsuite AND Reshaper: For highlighting cacheable responses.

Configure burpsuite to add custom columns using bambada code e.g.

Age Cf-Cache-Status X-Cache

X-Cacheable

  • Intruder with NULL payloads: For testing short cache durations (under 5 seconds).

  • CDN Headers for Debugging:

    • Akamai: Pragma: akamai-x-check-cacheable

    • Cloudflare: Fastly-Debug: 1

Web Cache Deception

• Use less known extensions such as .avif

chat.openai[.]com/api/auth/session.css → 400

chat.openai[.]com/api/auth/session/test.css → 200

The difference

What is the difference between web cache poisoning and web cache deception?

  • In web cache poisoning, the attacker causes the application to store some malicious content in the cache, and this content is served from the cache to other application users.

  • In web cache deception, the attacker causes the application to store some sensitive content belonging to another user in the cache, and the attacker then retrieves this content from the cache.

Resources AND Practice Labs

Web Cache Poisoning

Online Practice Labs

Web Cache Poisoning Denial of Service

Web Cache Deception

Online Practice Labs

Top Web Cache reports from HackerOne:

To test for web cache deception try one of the several path confusing payloads as shown below: ● ● ● ● ●

hacktricks ->

to PayPal - 811 upvotes, $9700

to Postmates - 343 upvotes, $500

to Glassdoor - 99 upvotes, $0

to GSA Bounty - 77 upvotes, $750

to Shopify - 72 upvotes, $2900

to OLX - 61 upvotes, $0

to Glassdoor - 55 upvotes, $0

to Discourse - 51 upvotes, $256

to Vanilla - 45 upvotes, $150

to Glassdoor - 43 upvotes, $0

to Smule - 35 upvotes, $0

to Discourse - 33 upvotes, $256

to U.S. Dept Of Defense - 32 upvotes, $0

to Algolia - 30 upvotes, $400

to Shopify - 26 upvotes, $800

to Lyst - 23 upvotes, $0

to Mail.ru - 22 upvotes, $400

to Algolia - 21 upvotes, $0

to Nextcloud - 21 upvotes, $0

to QIWI - 20 upvotes, $0

to Basecamp - 17 upvotes, $1700

to Mail.ru - 17 upvotes, $0

to Acronis - 15 upvotes, $0

to Chaturbate - 14 upvotes, $0

to ok.ru - 13 upvotes, $0

to Kaspersky - 13 upvotes, $0

to U.S. General Services Administration - 13 upvotes, $0

to TikTok - 10 upvotes, $0

to Semrush - 3 upvotes, $0

🕸️
example.com/nonexistent.css
example.com/%0nonexistent.css
example.com/%3Bnonexistent.css
example.com/%23nonexistent.css
example.com/%3Fname=valnonexistent.css
Omer Gil: Web Cache Deception Attack
https://portswigger.net/research/practical-web-cache-poisoning
https://portswigger.net/research/web-cache-entanglement
https://portswigger.net/web-security/all-labs#web-cache-poisoning
https://cpdos.org/
https://portswigger.net/research/responsible-denial-of-service-with-web-cache-poisoning
https://youst.in/posts/cache-poisoning-at-scale/
https://zhero-web-sec.github.io/research-and-things/nextjs-and-cache-poisoning-a-quest-for-the-black-hole
https://www.usenix.org/conference/usenixsecurity20/presentation/mirheidari
https://www.usenix.org/conference/usenixsecurity22/presentation/mirheidari
https://portswigger.net/research/gotta-cache-em-all
https://portswigger.net/web-security/all-labs#web-cache-deception
https://portswigger.net/web-security/web-cache-poisoning
https://github.com/carlospolop/hacktricks/blob/master/pentesting-web/cache-deception.md
https://portswigger.net/web-security/web-cache-poisoning/exploiting#using-web-cache-poisoning-to-exploit-cookie-handling-vulnerabilities
https://hackerone.com/reports/593712
https://youst.in/posts/cache-poisoning-at-scale/
https://bxmbn.medium.com/how-i-test-for-web-cache-vulnerabilities-tips-and-tricks-9b138da08ff9
DoS on PayPal via web cache poisoning
Web cache poisoning attack leads to user information and more
Web Cache Poisoning leads to Stored XSS
Defacement of catalog.data.gov via web cache poisoning to stored DOMXSS
https://themes.shopify.com::: Host header web cache poisoning lead to DoS
web cache deception in https://tradus.com lead to name/user_id enumeration and other info
Web Cache Poisoning leads to XSS and DoS
CSRF-tokens on pages without no-cache headers, resulting in ATO when using CloudFlare proxy (Web Cache Deception)
Web cache deception attack on https://open.vanillaforums.com/messages/all
[https://www.glassdoor.com] - Web Cache Deception Leads to gdtoken Disclosure
Web cache poisoning leads to disclosure of CSRF token and sensitive information
Web Cache Deception Attack (XSS)
Web Cache Poisoning on █████
Web Cache Deception vulnerability on algolia.com leads to personal information leakage
Shopify.com Web Cache Deception vulnerability leads to personal information and CSRF tokens leakage
Web Cache poisoning attack leads to User information Disclosure and more
Web cache information leakage at sbermarket.ru
Web Cache Deception Attack (XSS)
https://help.nextcloud.com::: Web cache poisoning attack
[*.rocketbank.ru] Web Cache Deception & XSS
HTTP request smuggling on Basecamp 2 allows web cache poisoning
Web Cache Poisoning
Web cache poisoning at www.acronis.com
Web cache deception attack - expose token information
[okmedia.insideok.ru] Web Cache Poisoing & XSS
Several domains on kaspersky.com are vulnerable to Web Cache Deception attack
Web Cache Poisoning leading to DoS
Information Leakage via TikTok Ads Web Cache Deception
Web cache deception attack - expose earning state information
Beyond Web Caching VulnerabilitiesMedium
Logo
https://x.com/_ayoubfathi_/status/1639637351042359296