
Apache Solr VelocityResponseWriter renders a user-provided template as code. Fixed in 8.3.1. Differential: directive executed on vuln, refused on fixed

Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

This repository contains the scanner component for Greenbone Community Edition.
| CVE | CVE-2019-17558 |
| Component | Apache Solr — VelocityResponseWriter |
| Affected | 5.0.0 through 8.3.0 |
| Fixed in | 8.3.1 |
| CWE | CWE-94 (Code Injection) |
| Impact | A user-defined configset could contain a Velocity template with executable directives. The VelocityResponseWriter rendered it, allowing remote code execution. |
| Vector | crafted Velocity template via configset or parameter |
| Trigger | Velocity directive such as #set in the template |
The vulnerable path:
# pre-fix (model from Apache Solr security bulletin)
attacker input accepted without the required protection
The derived guard:
# derived from observed behaviour, not copied from a vendor fix
if '#set(' in template or '@java' in template: reject
User-supplied templates were rendered as code. The fix disables that path by default.
| service | image | role |
|---|---|---|
s58-vuln | cve-2019-17558:vuln | vulnerable behaviour present |
s58-guard | cve-2019-17558:guard | fixed behaviour |
poc | cve-2019-17558-poc:local | stdlib-only Python driver |
Both sides are Python 3.12 images. The vulnerable behaviour is modelled from Apache Solr security bulletin; 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 cve17558lab network and bounded containers.
poc/poc.py takes a mode and an optional --host=...:
| mode | result |
|---|---|
check | exit 1 when the directive executes, 0 when the template is refused |
exploit | runs the full chain and reports the observed impact |
probe | prints the rce flag |
mitigation | explains the derived guard |
A standalone exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=s58-vuln
It exits 1 on a confirmed finding and 0 on a guarded target.
s58-vuln (pre-fix) | s58-guard (derived) | |
|---|---|---|
| crafted request | RCE | 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 cve17558lab 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