
PHPMailer isMail transport injects mail() arguments through Sender. Fixed in 5.2.18. Differential: arguments injected on vuln, refused on fixed
| CVE | CVE-2016-10033 |
| Component | PHPMailer — isMail transport |
| Affected | before 5.2.18 |
| Fixed in | 5.2.18 |
| CWE | CWE-88 (Argument Injection) |
| Impact | The mailSend function passed a crafted Sender property to the mail command. A backslash-double-quote sequence could inject extra parameters and execute arbitrary code. |
| Vector | crafted Sender field in a mail form |
| Trigger | Sender containing escape or shell metacharacters |
The vulnerable path:
# pre-fix (model from PHPMailer security advisory)
attacker input accepted without the required protection
The derived guard:
# derived from observed behaviour, not copied from a vendor fix
reject backslash-quote and shell metacharacters in Sender
The Sender value reached the shell command without validation. The fix validates it before calling mail().
| service | image | role |
|---|---|---|
pm33-vuln | cve-2016-10033:vuln | vulnerable behaviour present |
pm33-guard | cve-2016-10033:guard | fixed behaviour |
poc | cve-2016-10033-poc:local | stdlib-only Python driver |
Both sides are Python 3.12 images. The vulnerable behaviour is modelled from PHPMailer 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 cve10033lab network and bounded containers.
poc/poc.py takes a mode and an optional --host=...:
| mode | result |
|---|---|
check | exit 1 when arguments are injected, 0 when the Sender is refused |
exploit | runs the full chain and reports the observed impact |
probe | prints the injected flag |
mitigation | explains the derived guard |
A standalone exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=pm33-vuln
It exits 1 on a confirmed finding and 0 on a guarded target.
pm33-vuln (pre-fix) | pm33-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 cve10033lab 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