
Offline checker for Spring Cloud Config CVE-2026-40982 — tells you whether your version line has an OSS fix at all (3.1.x/4.1.x/4.2.x: it does not)
Spring Cloud Config CVE-2026-40982 offline troubleshooting tool — zero dependencies, single jar, no network access.
It doesn't answer "am I affected?" — it answers the more painful question:
On my version line, is there actually a secure version on Maven Central that I can upgrade to?
For the three lines 3.1.x / 4.1.x / 4.2.x, the answer is no.
官方 advisory(spring.io/security/cve-2026-40982)给出的修复版:
| 版本线 | 官方修复版 | 可得性 | Maven Central 上该线最高版 | 你能升上去吗 |
|---|---|---|---|---|
| 3.1.x | 3.1.14 | Enterprise Support Only | 3.1.10 | ❌ |
| 4.1.x | 4.1.10 | Enterprise Support Only | 4.1.7 | ❌ |
| 4.2.x | 4.2.7 | Enterprise Support Only | 4.2.4 | ❌ |
| 4.3.x | 4.3.3 | OSS | 4.3.4 | ✅ |
| 5.0.x | 5.0.3 | OSS | 5.0.4 | ✅ |
Those three fixed versions are not in public repositories. Anyone can verify:
curl -sI https://repo1.maven.org/maven2/org/springframework/cloud/spring-cloud-config-server/4.2.7/
# HTTP/1.1 404 Not Found
And automated tools won't tell you this — in the structured data of the GitHub advisory,
the first_patched_version for these three lines is simply null:
{"range": "<= 3.1.13", "first_patched_version": null}
{"range": ">= 4.1.0, <= 4.1.9", "first_patched_version": null}
{"range": ">= 4.2.0, <= 4.2.6", "first_patched_version": null}
{"range": ">= 4.3.0, <= 4.3.2", "first_patched_version": "4.3.3"}
{"range": ">= 5.0.0, <= 5.0.2", "first_patched_version": "5.0.3"}
Dependabot / OSV consume exactly this data. Without an upgrade target, no upgrade recommendation can be given.
java -jar scc-check.jar <目录或 jar/war 路径>
# 中文乱码时(Windows 控制台代码页与 Java 判断常常对不上):
java -jar scc-check.jar target/ --utf8
需要 Java 17+。运行时零依赖,可直接丢进离线环境。
退出码:2 有版本线升不上去 · 1 受影响但可升 / 判不了 · 0 未发现 · 3 用法或路径错
.jar / .war 文件名BOOT-INF/lib/、WEB-INF/lib/)META-INF/maven/.../pom.properties)—— jar 被改名也认得出pom.xml1. 不把客户端算成受影响。
本 CVE 只影响服务端 spring-cloud-config-server。引了 spring-cloud-starter-config
(客户端)的项目不受影响,工具会明确告诉你,而不是让你白紧张。
2. 不对 4.0.x 下判定。
官方 advisory 的任何区间都没有覆盖 4.0.x(4.0.0 > 3.1.13,不落在无下界那条里)。
工具只报「不在官方覆盖范围内」,不报 CRITICAL —— 靠推测填判定表会让人做错决定。
3. 读不出版本时明说「判不了」,绝不当成安全。
Spring Cloud 用 release train 统一管版本,pom.xml 里常常根本没有 <version>。
这种情况工具会告诉你去扫构建产物,而不是假装没找到问题。
同样,scope 为 test / provided 的依赖不传递给使用者,不算暴露面;
被 XML 注释包住的依赖会被剥掉。
tools/gen_rules.py 从两个一手数据源编译出 RuleTable.java:
GHSA-6g23-24mc-hx6x → 受影响区间 + 官方修复版repo1.maven.org 的 maven-metadata.xml → 公开仓库里实际存在的版本并带四条断言:区间数 ≥5、first_patched=null 的 ≥3、版本线 ≥5、判为
ENTERPRISE_ONLY 的 ≥3。任何一条不满足就直接中止,不生成文件 ——
否则解析一失败就会产出一张空表,而单元测试对着空表照样全绿。
python tools/gen_rules.py # 重新生成判定表
mvn test # 31 个测试
This tool only performs version comparison. It does not check whether your Config Server is actually exposed to the public internet, whether it has a WAF, or whether it has been mitigated by other means. The results are a starting point for investigation, not a security conclusion. Refer to the official advisory.
MIT
This tool answers "am I affected or not". The following questions it cannot answer, but I can help with:
📮 [email protected] — Describe the situation, and within 24 hours I will give you a one-page written reply: whether it can be done, where the difficulty lies, and roughly how long it will take. This step is free, and you don't need to commit to anything first.
| Code | Meaning |
|---|---|
0 | Scan completed, and every file was actually read, with no findings requiring action |
4 | Some file could not be read — not a zip, truncated content, or read failure |
🔴 4 was added on 2026-09-09, and the reason for adding it is worth explaining clearly.
Before that, unreadable files only left a single line of notice in the output, while the exit code remained 0 —
the trace was for humans to see, but CI and scripts look at the exit code, so "I couldn't read it" meant "passed" in automation.
A corrupted, encrypted, or incompletely downloaded jar would quietly turn into "no issues found".
"I can't read it" and "you are safe" must be two different statements.
⚠️ A legitimate empty jar does not count as unreadable (a 22-byte EOCD record is a real empty zip), and will not trigger 4 —
when there are too many false alarms, no one pays attention to the real ones.
For the meaning of the other exit codes, see the judgment tiers and usage instructions above.