用途:针对将用户上传文件托管在自己源(如 cdn.target.com)下的公开存储桶(S3、MinIO 及兼容服务),通过查询参数覆盖响应 Content-Type,把存储的 HTML/JS 载荷变为同源存储型 XSS,绕过上传时的扩展名白名单、magic byte 与强制 Content-Type 校验。
主要能力:检测对象 Content-Type 是否可被覆盖;区分匿名可覆盖(MinIO)与需签名(AWS S3);使用响应头覆盖参数(response-content-type、response-content-disposition、response-cache-control、response-content-encoding、response-content-language);用 boto3 生成带 ResponseContentType 的预签名 URL;借 SignatureDoesNotMatch 错误泄露真实桶主机与区域。
使用方式:前置条件为 curl、python3、一个公开对象 URL,S3 利用需自有 AWS 账号。快速检测:curl --max-time 30 --connect-timeout 10 -skI "https://cdn.target.com/uploads/avatar123.png?response-content-type=text/html" | grep -i content-type。返回 text/html 即 MinIO 匿名可覆盖;返回 Request specific response headers cannot be used for anonymous GET requests 说明是 S3,需签名请求。流程:识别公开对象(探测 /uploads/ 等路径、在页面中匹配 s3./amazonaws./minio 等签名);测试覆盖;MinIO 上传 polyglot 文件(如 PNG 头加 script)后带覆盖参数访问;S3 用 boto3 生成预签名 URL;验证对象是否在目标域下以确认同源。
限制:跨域桶影响低;并非所有存储系统支持覆盖参数;文件仍须通过上传校验;预签名 URL 会过期;CloudFront/CDN 可能缓存原始 Content-Type,需同时测试 CDN 与直连桶地址。相关技能包括 hunt-xss、hunt-cloud-misconfig、firebase-supabase-attack、js-secrets-extraction。官方文档未提供更多信息。