CVE-2026-126170 — FortiManager / FortiAnalyzer JSON-RPC (JRPC) API JSON Injection to Unauthenticated RCE
Published: 2026-11-25 • Researcher: googlesky (Lê Hiếu) — PoC; Fortinet PSIRT — advisory FG-IR-26-219
- Severity
- Critical
- CVE
- CVE-2026-126170 (Fortinet FG-IR-26-219)
- Category
- network
- Affected product
- Fortinet FortiManager, FortiManager Cloud, FortiAnalyzer, FortiAnalyzer Cloud, FortiAnalyzer-BigData — JSON-RPC (JRPC) API, POST /jsonrpc
- Affected versions
- FortiAnalyzer 8.0.0–8.0.2, 7.6.0–7.6.7; FortiAnalyzer Cloud 8.0.1–8.0.2, 7.6.0–7.6.7; FortiAnalyzer-BigData 7.6.0–7.6.2; FortiManager 8.0.0–8.0.2, 7.6.0–7.6.7; FortiManager Cloud 8.0.1–8.0.2, 7.6.0–7.6.7 (NVD)
- Disclosed
- 2026-11-25
- Patch status
- Unverified
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-126170
- https://fortiguard.fortinet.com/psirt/FG-IR-26-219
- https://www.fortiguard.com/psirt/FG-IR-26-219
- https://www.cve.org/CVERecord?id=CVE-2026-126170
- https://github.com/googlesky/CVE-2026-126170
- https://cwe.mitre.org/data/definitions/116.html
- https://jsonrpc.org/specification
- https://docs.fortinet.com/product/fortimanager
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-11-19 |
| Author / Researcher | googlesky (Lê Hiếu) — PoC; Fortinet PSIRT — advisory FG-IR-26-219 |
| CVE / Advisory | CVE-2026-126170 (Fortinet FG-IR-26-219) |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| Status | PoC |
| Tags | RCE, unauthenticated, FortiManager, FortiAnalyzer, JSON-injection, CWE-116, JRPC, command-injection, appliance, HTTP |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Fortinet FortiManager, FortiManager Cloud, FortiAnalyzer, FortiAnalyzer Cloud, FortiAnalyzer-BigData — JSON-RPC (JRPC) API, POST /jsonrpc |
| Versions Affected | FortiAnalyzer 8.0.0–8.0.2, 7.6.0–7.6.7; FortiAnalyzer Cloud 8.0.1–8.0.2, 7.6.0–7.6.7; FortiAnalyzer-BigData 7.6.0–7.6.2; FortiManager 8.0.0–8.0.2, 7.6.0–7.6.7; FortiManager Cloud 8.0.1–8.0.2, 7.6.0–7.6.7 (NVD) |
| Language / Platform | Appliance management plane; JSON-RPC 2.0 over HTTP(S); FortiOS-style CLI command sink; PoC is Python 3 (stdlib only) |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
An improper output encoding flaw (CWE-116) in the JSON-RPC API of Fortinet FortiManager and FortiAnalyzer lets an unauthenticated attacker execute arbitrary commands on the appliance through a crafted HTTP request. The handler copies request values into a generated FortiOS-style command line and into the JSON response document without escaping them for either destination, so a value carrying a double quote terminates the quoted argument and the remainder is parsed by the command sink. Fortinet rates the issue 9.8 critical with a network vector, no privileges and no user interaction, reachable only where the JSON API has been enabled because it is disabled by default. The public PoC reproduces the full chain against a containerised model of the JRPC API and demonstrates command execution as root plus a forged key in the parsed response.
Vulnerability Details
Root Cause
The JRPC handler of the appliance translates a JSON-RPC document into a FortiOS-style command line and into a JSON response document, and it writes the values of the request into both outputs without encoding them for the destination they enter (CWE-116). The handler recovers each value from the raw request text and interprets the request’s own JSON escapes, so a double quote on the wire becomes a literal double quote in the recovered value. That value is then placed inside double quotes on the generated command line without escaping, and concatenated verbatim into the response document.
In the containerised model shipped with this entry (lab/fmgr_jrpc.py), the vulnerable mode renders the value as "<value>" and hands the resulting command line to /bin/sh -c; the patched mode shell-quotes the value for the command line, JSON-escapes it for the response document, and executes the command line without a shell. The model is the only thing that runs in the upstream laboratory — Fortinet does not publish the handler’s source, so the model encodes the vulnerability class and the vendor-stated behaviour, not the vendor binary.
Attack Vector
An unauthenticated POST /jsonrpc with Content-Type: application/json and a JSON-RPC 2.0 document:
{"id":1,"method":"set","params":[{"url":"/api/v2/cmdb/system/admin","data":{"description":"A\",\"jrpc_injected\":\"TOKEN`id > /results/marker/jrpc-TOKEN.txt; echo TOKEN >> /results/marker/jrpc-TOKEN.txt`"}}]}The injected value carries three things at once: the double quote that closes the quoted argument of the generated command line and the string of the response document, a JSON key/value pair that becomes a real key of the response, and a command substitution the command sink evaluates. The upstream matrix also reproduces the defect through the url, the id, the session and the data key names, over the get, set, add, delete and exec methods, and through the REST path /api/v2/cmdb/<object>, which reaches the same encoder. In the model, the request is dispatched before the session is validated, so a request with no session — or an invalid one — still reaches the vulnerable encoder; that ordering is part of the modelled defect.
Impact
Remote command execution on the appliance as the account the management daemon runs with (uid=0(root) in the upstream laboratory), which is full compromise of a device that manages firewalls and stores their configuration and logs. The same request also injects attacker-controlled keys into the JSON response document, so a client that parses the response sees forged data. Because the management plane controls managed FortiGate devices, a compromised instance can be used to push configuration to the estate it administers.
Environment / Lab Setup
OS: Linux x86_64 (Podman host)
Target: Containerised model of the FortiManager / FortiAnalyzer JRPC API
(python:3.12-slim), four modes: vuln (7.6.7), fixed (7.6.8),
fixed-rpc-none (rpc-permit none), api-disabled
Attacker: python:3.12-alpine PoC container on the podman network cve126170lab
Tools: podman, make, bash, Python 3
Network: podman network cve126170lab; model listens on TCP 8080
Volumes: ./results mounted at /results (marker files + jrpc-command-log.txt)Setup Steps
| |
run-lab.sh exposes the same drivers: ./run-lab.sh up|check|exploit|probe|mitigation|0day|differential|evidence|down.
Proof of Concept
Step-by-Step Reproduction
Start the laboratory —
make prepare && make upbuilds the two images and startsfmgr-jrpc-vuln(modevuln, FortiManager 7.6.7 model),fmgr-jrpc-fixed(7.6.8),fmgr-jrpc-rpc-noneandfmgr-jrpc-api-disabledon the podman networkcve126170lab.Classify the vulnerable model —
make check-vulnrunspoc/poc.py check, which sends one benigngetrequest and one injectedsetrequest and exits1onVULNERABLE.Run the full chain —
make exploit-vulnruns the PoC container againsthttp://fmgr-jrpc-vuln:8080:Shell script1 2 3podman run --rm --cpus 2 --memory 4g --network cve126170lab \ -v "$PWD/results:/results" cve-2026-126170-poc:local \ exploit --target http://fmgr-jrpc-vuln:8080Inspect the proof — the PoC generates a fresh random token, embeds it in the
descriptionvalue of aseton/api/v2/cmdb/system/admin, and verifies three things: the response document carries the injected keyjrpc_injected_<token>, the command log recorded the generated command line, and/results/marker/jrpc-<token>.txtcontains the token together withuid=0(root).Contrast with the patched build —
make exploit-fixedsends the identical request to the 7.6.8 model; the value stays a single string, no marker is written, no key is injected, and the PoC exits0(SAFE).Confirm the workaround —
make mitigationshows403 Access denied: rpc-permit noneon thefixed-rpc-nonemodel and404 Object not foundon theapi-disabledmodel.
The equivalent raw request against a real appliance, from the upstream write-up (documented, not executed here):
| |
Exploit Code
See
exploit.pyfor the standalone full-chain exploit (it forcesexploitmode and exits1when the target is exploited),poc/poc.pyfor the differential harness withcheck,exploit,probe,mitigationand0daymodes, andlab/fmgr_jrpc.pyfor the vulnerable model that the chain runs against.
The standalone entry point only needs the target and the shared results volume:
| |
The chain shape is:
| |
Expected Output
Abridged from evidence-exploit-vulnerable-run.txt:
| |
Screenshots / Evidence
evidence-exploit-vulnerable-run.txt— full chain against the vulnerable model: injected key, generated command line, marker withuid=0(root).evidence-check-vulnerable-run.txt— classification run: benign request200, injected requestVULNERABLE, exit1.evidence-versions.txt— models, reported versions, listener and image digests recorded upstream.
The upstream repository also carries evidence/exploit-fixed-run.txt, evidence/probe-*.txt, evidence/0day-sweep.txt, evidence/jrpc-command-log.txt and evidence/injected-markers.txt; those were not copied (bulk run logs).
Detection & Indicators of Compromise
POST /jsonrpcrequest bodies whosedatavalues,datakey names,url,idorsessioncontain a double quote followed by,and a new key, or shell metacharacters (backtick,$(,;,|,&&,>); the vulnerable handler interprets the request’s own JSON escapes, so a JSON-encoded value is enough.- Response documents that carry unexpected top-level keys such as
jrpc_injected_*, or responses that no longer parse as strict JSON because a value destroyed the document. - Generated command lines containing shell substitution (
config system admin,set "description" "A","...") in management-plane logs, plus marker or result files written by the injected command. - Appliance-side
403 Access denied: rpc-permit noneor404 Object not foundresponses from/jsonrpcindicate the workaround states, not exploitation. - Authentication ordering tell: in the vulnerable build a request carrying an unknown
sessionis executed before the session is refused; a401on the same payload against a patched build is the safe ordering.
SIEM / IDS rule (example):
| |
The rule targets the response/command-line breakout shape; validate it against your own management-plane logging before relying on it. The laboratory’s own detector is poc/poc.py check, which classifies a target by comparing a benign and an injected request.
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade FortiManager and FortiAnalyzer to 8.0.3 or 7.6.8, FortiAnalyzer-BigData to 7.6.3, and migrate FortiSASE-Sovereign 25, 25.3 and 25.4 to a fixed release (per FG-IR-26-219 as reported in the upstream README); the Cloud branches follow the 8.0.3 / 7.6.8 line. |
| Workaround | Disable the JSON API on every administrative profile: config system admin profile, edit <profile_name>, set rpc-permit none, end. The JSON API refuses every request with 403 in that state. |
| Config Hardening | Keep the JSON API disabled on appliances that do not need it (the default), restrict the management interface to dedicated administrative networks, and treat any single unencoded request value as a full-management-plane compromise. |
References
Notes
Auto-ingested from https://github.com/googlesky/CVE-2026-126170 on 2026-11-25.
Review verdict: real exploit code, not a detector. exploit.py and poc/poc.py craft and send the injection request, then verify command execution out of band through a per-run marker file and verify the injected key in the parsed response; the check mode is only a classification convenience, not the purpose of the repository. The upstream tree is MIT licensed (Copyright (c) 2026 Lê Hiếu), and the license is archived as upstream-LICENSE.txt.
Fidelity and limitations: FortiManager and FortiAnalyzer are proprietary, so the upstream laboratory does not exercise the vendor binary. It runs a Python model of the JRPC API (lab/fmgr_jrpc.py) that reproduces the vulnerable and the patched behaviour, and every claim about the appliance is taken from FG-IR-26-219 and the published JRPC request surface. The command sink is /bin/sh -c in the vulnerable mode and the PoC writes its marker to /results on the container filesystem, so the proof is lab-only; the request shape and payload are documented but the chain has not been validated against a real appliance. Status is therefore PoC rather than Weaponized.
Layout: the entry keeps the upstream lab/ and poc/ directories so that Makefile and the Containerfiles still build. The standalone upstream exploit/exploit.py was archived as the top-level exploit.py and the Makefile exploit target was adjusted accordingly; the two upstream files differ only in the standalone entry point. Not copied: .git, CITATION.cff, .gitignore, results/, and the bulk evidence logs listed above. The worklist slug cve-2026-126170-poc was kept for the entry directory name.
No public exploitation was reported at the publication date of the advisory (per the upstream README and FG-IR-26-219). Run only against systems you own or have written authorization to test.
| |