Junos OS (kernel, shell access)
CVE-2025-21590: Junos OS shell-to-code flaw, used to backdoor MX routers
A kernel isolation flaw lets an attacker with root shell access run code on a Junos OS device and get around its binary protections. Exploited by the China-nexus group UNC3886 since mid-2024 and on CISA's KEV list; no public proof of concept is confirmed.
Published Updated Juniper Networks advisory JSA93446
Affected and fixed versions
| Product / branch | Fixed in |
|---|---|
| Junos OS before 21.2R3-S9 | 21.2R3-S9 or later (use 21.2R3-S9.21; S9.20 was incomplete) |
| Junos OS 21.4 | 21.4R3-S10 or later |
| Junos OS 22.2 | 22.2R3-S6 or later |
| Junos OS 22.4 | 22.4R3-S6 or later |
| Junos OS 23.2 | 23.2R2-S3 or later |
| Junos OS 23.4 | 23.4R2-S4 or later |
| Junos OS 24.2 | 24.2R1-S2, 24.2R2 or later |
Always confirm against the vendor advisory, which lists every fixed hotfix.
What it is
Junos OS is built on FreeBSD. Its veriexec feature stops unauthorized binaries from running. CVE-2025-21590 is a kernel flaw (improper isolation, CWE-653) that lets an attacker with high privileges and shell access inject code and compromise the device. It can’t be triggered from the Junos CLI. Amazon found it in its own security research.
The CVSS 4.0 score is only 6.7 (medium) because the attacker needs local, privileged access. Don’t let that set your priority. Mandiant reported that UNC3886, a China-nexus espionage group, used it against Juniper MX routers on end-of-life hardware and software from mid-2024. The attackers already had legitimate credentials, taken from a terminal server used to manage network devices. They went from the Junos CLI to the FreeBSD shell and had root.
To get past veriexec, they injected shellcode into a trusted process (a hung cat) rather than run a new binary. That loaded the lmpad backdoor. Mandiant found six TINYSHELL-based backdoors in all, some of which disable logging and delete log entries. Juniper says at least one exploitation was reported to its SIRT. CISA lists the CVE in KEV; its entry gives known ransomware use as unknown.
Am I affected?
You’re affected if you run Junos OS older than:
- 21.2R3-S9 (only 21.2R3-S9.21 is a complete fix; S9.20 was not)
- 21.4R3-S10
- 22.2R3-S6
- 22.4R3-S6
- 23.2R2-S3
- 23.4R2-S4
- 24.2R1-S2 or 24.2R2
Release 24.4R1 and later are fixed. The CVE record also lists platform exceptions, where the fix is not in every platform in the releases above:
- SRX300 Series: 21.2R3-S9, 23.4R2-S5 (future release) or 24.4R1
- SRX550HM: 22.2R3-S7 (future release)
- EX4300 Series: 21.4R3-S11 (future release), except EX4300-48MP
- EX4600: 21.4R3-S11 (future release), except EX4650
- ACX1000, ACX1100, ACX2100, ACX2200, ACX4000, ACX500 and MX104: 21.2R3-S9
Real-world risk is highest where an attacker can reach a Junos shell: shared or weakly protected admin credentials, exposed terminal servers, and end-of-life MX routers.
What to do
- Upgrade to a fixed release for your branch. On the 21.2 branch, use 21.2R3-S9.21, not S9.20. If the fix for your platform is a “future release”, apply step 2 and track Juniper’s advisory.
- Restrict shell access to trusted users only. This is Juniper’s workaround. Mandiant adds centralized authentication with MFA and role-based access for device management, plus segmentation of the management network and the terminal servers that reach it.
- After upgrading, run the Juniper Malware Removal Tool (JMRT) Quick Scan and Integrity Check, as Mandiant recommends. Get the tool and its instructions from Juniper.
- If a device was reachable by attackers while vulnerable, treat it as possibly compromised and check it against the indicators below. If you find a match, isolate it, reimage it from a clean image, and rotate every credential it held or that managed it, including terminal-server and TACACS+ accounts. Mandiant also saw a backdoored TACACS+ daemon on Linux hosts in this campaign.
- Replace end-of-life routers. The observed targets were out of support.
Detection
The lmpad backdoor turns off logging and deletes traces, so missing logs are a signal too. Mandiant reports these behaviours:
- Files and paths:
/var/tmp/pfed_jdhcp6_trace.log,/var/tmp/rts,/var/tmp/ldb*,/var/rundb+,/usr/lib/libjucomm.so.1,/config/usage_db, and a named pipe callednullin a working directory. - Look-alike daemons:
appid,to,irad,lmpad,jdosdandoemd, which mimicappidd,top,irsd,lmpd,jddosdandoamd. Compare hashes with the indicators above. - Listening ports: UDP 33615 (lmpad), UDP 33512 (jdosd), TCP 31234 (irad), and TCP or UDP 45678 (oemd default).
- Outbound connections on TCP 22 to the C2 addresses listed above.
- Log tampering:
syslog.confentries redirected to/dev/null, gaps in/var/log/messages,/var/log/authorinteractive-commands, and suppressed SNMP traps. - Network signatures: Mandiant published Snort/Suricata rules for the backdoors’ UDP and ICMP triggers, and YARA rules (
M_Hunting_TINYSHELL_5,M_Hunting_PacketEncryptionLayer_1). Get them from its report.
Indicators of compromise
These come from the 2024 UNC3886 campaign. The backdoors masquerade as legitimate Junos daemons (appidd, top, irsd, lmpd, jddosd, oamd), so match on hash and path, not process name. Mandiant also lists MD5 and SHA-1 values in its report.
The .txt list has one IP per line and a fixed address, so a firewall can pull it as an External Dynamic List: https://patchtonight.com/iocs/CVE-2025-21590.txt
| Indicator | Type | Reported by |
|---|---|---|
| 129.126.109[.]50 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 116.88.34[.]184 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 223.25.78[.]136 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 45.77.39[.]28 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 101.100.182[.]122 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 118.189.188[.]122 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 158.140.135[.]244 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| 8.222.225[.]8 | IPTINYSHELL C2, port 22 | Mandiant (Google Threat Intelligence) |
| /var/tmp/pfed_jdhcp6_trace.log | File pathDropped by lmpad (gzip-compressed script) | Mandiant (Google Threat Intelligence) |
| /var/tmp/rts | File path | Mandiant (Google Threat Intelligence) |
| /var/rundb+ | File path | Mandiant (Google Threat Intelligence) |
| /usr/lib/libjucomm.so.1 | File path | Mandiant (Google Threat Intelligence) |
| /config/usage_db | File path | Mandiant (Google Threat Intelligence) |
| 98380ec6bf4e03d3ff490cdc6c48c37714450930e4adf82e6e14d244d8373888 | SHA-256appid (SHA-256) | Mandiant (Google Threat Intelligence) |
| e1de05a2832437ab70d36c4c05b43c4a57f856289224bbd41182deea978400ed | SHA-256to (SHA-256) | Mandiant (Google Threat Intelligence) |
| 5bef7608d66112315eefff354dae42f49178b7498f994a728ae6203a8a59f5a2 | SHA-256irad (SHA-256) | Mandiant (Google Threat Intelligence) |
| 5995aaff5a047565c0d7fe3c80fa354c40e7e8c3e7d4df292316c8472d4ac67a | SHA-256lmpad (SHA-256) | Mandiant (Google Threat Intelligence) |
| 7ae38a27494dd6c1bc9ab3c02c3709282e0ebcf1e5fcf59a57dc3ae56cfd13b4 | SHA-256lmpad, second sample (SHA-256) | Mandiant (Google Threat Intelligence) |
| c0ec15e08b4fb3730c5695fb7b4a6b85f7fe341282ad469e4e141c40ead310c3 | SHA-256jdosd (SHA-256) | Mandiant (Google Threat Intelligence) |
| 905b18d5df58dd6c16930e318d9574a2ad793ec993ad2f68bca813574e3d854b | SHA-256oemd (SHA-256) | Mandiant (Google Threat Intelligence) |
| 3751997cfcb038e6b658e9180bc7cce28a3c25dbb892b661bcd1065723f11f7e | SHA-256oemd, second sample (SHA-256) | Mandiant (Google Threat Intelligence) |
Sources
Spotted a mistake on this page? Tell us, and we'll fix it.
Page changelog
- Full analysis published.
KEV status, EPSS score and vendor data refreshed automatically, last on 3 Dec 2026.