返回 Bug 清单
BUG-0204project-28高已修复deploy-config

以 HTTP 200 判定服务暴露 —— SPA catch-all 造成假阳性

发现:2026-09-30验证:2026-10-09置信度:95%

症状

对 20 个 /actuator/* 路径逐个请求,全部返回 200|203285,据此判定「Spring Actuator 暴露、可能泄露 env/heapdump」。

根因

被测站是 SPA(Next.js 等),配置了 try_files $uri $uri/ /index.html,任何未命中静态文件的路径都回退到首页并返回 200。因此【状态码不携带『该路径存在』这一信息】。

修复方案

判据必须包含【内容指纹】而非仅状态码: 1) 请求一个必然不存在的路径(如 /this-path-cannot-exist-9f8a7b6c)作为对照; 2) 若敏感路径的响应【大小与 content-type 与对照完全相同】⇒ 是 catch-all,非暴露; 3) 再直连后端端口(绕开反代)确认:本例 127.0.0.1:8081/actuator → 404 application/json,即后端根本没启用 Actuator。

检测命令

curl -s -o /dev/null -w '%{http_code}|%{size_download}' https://<host>/actuator/env; curl -s -o /dev/null -w '%{http_code}|%{size_download}' https://<host>/nonexistent-xyz

修复命令

diff <(curl -s https://<host>/actuator/env) <(curl -s https://<host>/nonexistent-xyz) && echo 'catch-all:状态码不可作为存在性证据'

错误签名

curl /actuator/env 返回 200 ⇒ 判定 Actuator 暴露;而所有不存在的路径同样返回 200

技术信息

来源项目

project-28

标签

false-positive, http-status-code, spa, verification-method