
Tomcat FileStore deserialization fix for CVE-2020-9484 was incomplete. Fixed in 9.0.42/8.5.62/7.0.108. Differential: traversal on vuln, refused on fixed

ماسح ثغرات سريع يعتمد على YAML مع محرك كشف قائم على القوالب للاختبار الأمني الآلي عبر تطبيقات الويب، وواجهات برمجة التطبيقات (APIs)، والشبكات، وDNS، والبنية التحتية السحابية.

ماسح أمني لتطبيقات الويب مفتوح المصدر للكشف الآلي عن الثغرات الأمنية، واختبار الاختراق اليدوي، واختبار أمان واجهات برمجة التطبيقات (API) باستخدام محرك اعتراض قائم على الوكيل.

يحتوي هذا المستودع على مكوّن الماسح الضوئي لإصدار Greenbone Community Edition.
| CVE | CVE-2021-25329 |
| Component | Apache Tomcat — PersistentManager FileStore |
| Affected | 9.0.0.M1-9.0.41; 8.5.0-8.5.61; 7.0.0-7.0.107 |
| Fixed in | 9.0.42 / 8.5.62 / 7.0.108 |
| CWE | CWE-502 (Deserialization of Untrusted Data) |
| Impact | The earlier fix for CVE-2020-9484 was incomplete in an edge-case configuration, again allowing a crafted session id to select a file for deserialization. |
| Vector | crafted JSESSIONID with path separators |
| Trigger | session id naming a file outside the store |
The vulnerable path:
# pre-fix (model from Apache Tomcat security advisory)
attacker input accepted without the required protection
The derived guard:
# derived from observed behaviour, not copied from a vendor fix
fully validate the session id before building the file path
The path check did not cover every separator and dot form. The fix validates all of them.
| service | image | role |
|---|---|---|
t29-vuln | cve-2021-25329:vuln | vulnerable behaviour present |
t29-guard | cve-2021-25329:guard | fixed behaviour |
poc | cve-2021-25329-poc:local | stdlib-only Python driver |
Both sides are Python 3.12 images. The vulnerable behaviour is modelled from Apache Tomcat security advisory; the guard is derived from the lab observation that the impact is reproduced. The fixed build applies the published upstream change.
./run-lab.sh build
./run-lab.sh up
./run-lab.sh sweep
./run-lab.sh down
The lab uses the isolated cve25329lab network and bounded containers.
poc/poc.py takes a mode and an optional --host=...:
| mode | result |
|---|---|
check | exit 1 when the traversal succeeds, 0 when the id is refused |
exploit | runs the full chain and reports the observed impact |
probe | prints the traversal flag |
mitigation | explains the derived guard |
A standalone exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=t29-vuln
It exits 1 on a confirmed finding and 0 on a guarded target.
t29-vuln (pre-fix) | t29-guard (derived) | |
|---|---|---|
| crafted request | deserialization | refused |
| ordinary request | works | works |
Captured runs are in evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt,
evidence/exploit-standalone-fixed-run.txt, evidence/versions.txt and
evidence/0day-sweep.txt.
Podman or Docker with the cve25329lab network. No production system is
involved. Real-world exploitation needs an affected installation.
Ordinary requests still succeed on the fixed build.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone exploit
lab/harness-*.py vulnerable behaviour / derived guard
lab/lab.Dockerfile builds both sides
lab/service.py HTTP wrapper (POST /check)
evidence/ captured runs on both sides
TRACKING.md working record, excluded from the repo