CVE-2021-31357

7.8 HIGH

📋 TL;DR

This CVE describes a command injection vulnerability in tcpdump command processing on Juniper Networks Junos OS Evolved. It allows authenticated users to bypass CLI command restrictions and execute arbitrary shell commands at their assigned privilege level. The vulnerability affects multiple versions of Junos OS Evolved prior to specific patched releases.

💻 Affected Systems

Products:
  • Juniper Networks Junos OS Evolved
Versions: All versions prior to 20.3R2-S1-EVO; 20.4 versions prior to 20.4R2-S2-EVO; 21.1 versions prior to 21.1R2-EVO; 21.2 versions prior to 21.2R1-S1-EVO, 21.2R2-EVO
Operating Systems: Junos OS Evolved
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated CLI access; affects only Junos OS Evolved, not traditional Junos OS

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An authenticated attacker with restricted CLI access could execute arbitrary shell commands, potentially gaining full administrative control of the device, exfiltrating sensitive data, or disrupting network operations.

🟠

Likely Case

An authenticated user with some CLI access could bypass their command restrictions to perform unauthorized actions, modify configurations, or access restricted system information.

🟢

If Mitigated

With proper access controls and network segmentation, the impact is limited to the specific device and user's assigned privilege level, preventing lateral movement or broader network compromise.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated CLI access; command injection in tcpdump processing allows bypass of command restrictions

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 20.3R2-S1-EVO, 20.4R2-S2-EVO, 21.1R2-EVO, 21.2R1-S1-EVO, or 21.2R2-EVO

Vendor Advisory: https://kb.juniper.net/JSA11221

Restart Required: Yes

Instructions:

1. Check current version with 'show version'. 2. Download appropriate patched version from Juniper support. 3. Install update following Juniper upgrade procedures. 4. Reboot device to complete installation.

🔧 Temporary Workarounds

Restrict tcpdump command access

all

Remove or restrict tcpdump command execution for non-privileged users through Junos configuration

set system login class <class-name> deny-commands "tcpdump"

Implement strict CLI command authorization

all

Review and tighten CLI command restrictions for all user classes

show configuration system login
edit system login class <class-name>

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate vulnerable devices
  • Enforce least privilege access controls and monitor CLI command usage

🔍 How to Verify

Check if Vulnerable:

Run 'show version' and check if version falls within affected ranges: prior to 20.3R2-S1-EVO, 20.4R2-S2-EVO, 21.1R2-EVO, 21.2R1-S1-EVO, or 21.2R2-EVO

Check Version:

show version

Verify Fix Applied:

After patching, verify version is at or above patched releases: 20.3R2-S1-EVO, 20.4R2-S2-EVO, 21.1R2-EVO, 21.2R1-S1-EVO, or 21.2R2-EVO

📡 Detection & Monitoring

Log Indicators:

  • Unusual tcpdump command usage patterns
  • CLI command execution outside user's normal profile
  • Shell command execution from CLI users

Network Indicators:

  • Unexpected configuration changes
  • Unusual outbound connections from network devices

SIEM Query:

source="junos" AND (command="tcpdump" OR command="shell") AND user!="root"

🔗 References

📤 Share & Export