Chaining file upload bypass and stored XSS to create admin accounts: walkthrough with Docker PoC lab
好的,我现在需要帮用户总结一篇文章的内容,控制在100字以内。用户的要求是直接写文章描述,不需要特定的开头。首先,我得仔细阅读文章内容,抓住关键点。 文章讲的是最近一次针对SaaS应用的渗透测试中发现的一个漏洞链。有两个中等严重性的漏洞:文件上传绕过和存储型XSS。这两个漏洞被串联起来,最终成功创建了管理员账户。 接下来,我需要理解技术细节。目标应用有CSP策略限制脚本来源为自身,CORS也锁得很紧,还有CSRF令牌在表单中使用。所有这些安全措施都正常工作。但攻击者通过保持同源的方式绕过了所有这些安全措施。 文件上传漏洞没有服务器端验证,只用了客户端的accept属性限制文件类型。攻击者上传了JS payload,这个payload通过应用自身的下载端点被同源服务器托管。然后利用存储型XSS,在管理员的消息系统中加载这个payload,通过img标签的onerror事件处理程序来获取并执行payload代码。最终payload利用管理员的会话cookie创建了一个后门管理员账户。 CSP没有阻止是因为脚本是同源托管的;CORS无关紧要因为没有跨域请求;CSRF令牌也没用因为同源JS可以直接读取DOM获取令牌。 此外,作者还写了一个完整的演练步骤、代码和截图,并且创建了一个Docker实验室环境来复现这个漏洞链。 现在我需要把这些信息浓缩到100字以内。重点包括:SaaS渗透测试、两个中等漏洞(文件上传和XSS)、串联创建管理员账户、绕过CSP、CORS、CSRF等安全措施的技术细节。 可能的结构是:描述渗透测试发现的漏洞链,如何利用这两个漏洞绕过安全措施并创建管理员账户,并提到作者提供的详细资料和实验室环境。 最后检查字数是否在限制内,并确保语言简洁明了。 </think> 文章描述了一次针对SaaS应用的安全渗透测试中的漏洞链利用案例。通过结合文件上传绕过和存储型XSS两个中等严重性漏洞,攻击者成功绕过CSP、CORS和CSRF保护,在同源环境下创建了管理员账户,并提供了详细的攻击步骤、代码和实验室环境复现。 2026-3-28 13:12:34 Author: www.reddit.com(查看原文) 阅读量:5 收藏

Write up of a vulnerability chain from a recent SaaS pen test. Two medium-severity findings (file upload bypass and stored XSS) chained together for full admin account creation.

The target had CSP restricting script sources to self, CORS locked down, and CSRF tokens on forms. All functioning correctly. The chain bypassed everything by staying same-origin the entire way.

The file upload had no server-side validation (client-side accept=".pdf" only), so we uploaded a JS payload. It got served back from the app's own download endpoint on the same origin. The stored XSS in the admin inbox messaging system loaded it via an <img onerror> handler that fetched the payload and eval'd it. The payload created a backdoor admin account using the admin's session cookie.

CSP didn't block it because the script was hosted same-origin via the upload. CORS irrelevant since nothing crossed an origin boundary. CSRF tokens didn't matter because same-origin JS can read the DOM and grab them anyway.

Full write up with attack steps, code, and screenshots: https://kurtisebear.com/2026/03/28/chaining-file-upload-xss-admin-compromise/

Also built a Docker lab that reproduces the exact chain with the security controls in place. PHP app, both vulns baked in, admin + user accounts seeded. Clone and docker-compose up: https://github.com/echosecure/vuln-chain-lab


文章来源: https://www.reddit.com/r/netsec/comments/1s5zzw1/chaining_file_upload_bypass_and_stored_xss_to/
如有侵权请联系:admin#unsafe.sh