CVE-2024-20399 — Cisco NX-OS Command Injection Vulnerability

CVE-2024-20399

Cisco NX-OS CLI — Local Admin Argument Injection Executes OS Commands as Root; Velvet Ant (China-Nexus) Used for Persistent Malware on Nexus Switches

What is Cisco NX-OS?

Cisco NX-OS is the operating system running on Cisco Nexus switches and MDS storage networking devices — the datacenter switching fabric used in enterprise and hyperscale environments. NX-OS provides the CLI for configuration and management of these switches, with different privilege tiers (user, operator, administrator). Network switches running NX-OS are high-value targets for nation-state actors because compromise of the network fabric provides a persistent, difficult-to-detect position for traffic interception, lateral movement, and persistent access — switches are rarely forensically investigated, rarely run endpoint detection tools, and often persist across security incidents that wipe endpoint environments.

Overview

CVE-2024-20399 is a command injection vulnerability in the Cisco NX-OS CLI, exploitable by a locally authenticated attacker with administrator-level privileges. Discovered by Sygnia during incident response against a large organization, the vulnerability was used by the China-nexus threat actor Velvet Ant to install persistent custom malware on Cisco Nexus switches — maintaining network-level access that survived the organization's remediation efforts on other systems. Cisco disclosed and patched the vulnerability on July 1, 2024; CISA added it to KEV the following day.

Affected Versions

Product Status
Cisco NX-OS (multiple Nexus platforms) Patched per Cisco advisory cisco-sa-nxos-cmd-injection-xD9OhyOP

Technical Details

CWE-78 (OS Command Injection). Specific CLI commands in NX-OS accept arguments that are not sufficiently sanitized before being passed to underlying shell functions. An authenticated attacker with administrator-level CLI access can craft argument strings containing injected shell metacharacters that cause the command to execute arbitrary OS-level commands as root. This escalates the attacker's access from the NX-OS CLI tier to the underlying Linux kernel environment, enabling installation of software and configuration changes that are not visible through normal NX-OS management interfaces.

The local attack vector (AV:L) reflects that the attacker must have CLI access — either through console, SSH, or Telnet — to the NX-OS device. The High privilege requirement (PR:H) means admin credentials are needed. In practice, attackers who have already achieved initial access to an organization's network can often obtain network device credentials from configuration management systems, TACACS/RADIUS databases, or by using the same credentials used on compromised endpoints.

Discovery

Discovered by Sygnia incident response team while investigating a long-term intrusion by Velvet Ant — a sophisticated China-nexus threat actor focused on espionage operations against large enterprises, financial institutions, and critical infrastructure. Sygnia reported the vulnerability to Cisco before public disclosure, following responsible disclosure practices. Cisco credits Sygnia in the advisory.

Exploitation Context

Velvet Ant's use of this vulnerability illustrates a sophisticated persistence strategy: after establishing initial access via other means, the threat actor identified NX-OS as an ideal persistent foothold because:

  1. Switches are rarely monitored for malware or included in endpoint detection programs
  2. Malware installed at the OS level on a switch persists across network device reboots
  3. Switch-level access provides visibility into all traffic traversing the network fabric
  4. Switch-based implants survived remediation efforts that focused on servers and endpoints

Velvet Ant installed custom malware on multiple Cisco Nexus switches, maintaining persistent access to the victim's network for an extended period. This is part of a broader pattern of China-nexus actors targeting network infrastructure as a resilient persistence layer — seen also in Volt Typhoon (SOHO router compromise) and other campaigns.

Remediation

  1. Apply Cisco patches per advisory cisco-sa-nxos-cmd-injection-xD9OhyOP to all affected NX-OS devices.
  2. Audit all NX-OS devices for signs of Velvet Ant or similar threat actor activity: unusual processes running in the NX-OS Linux environment (bash show system internal kernel processes), unexpected files in /bootflash, and non-standard NX-OS feature configurations.
  3. Restrict NX-OS administrator access to a dedicated out-of-band management network accessible only from bastion hosts — no switch management traffic on production VLANs.
  4. Implement strong authentication for network device management: use TACACS+ with unique, device-specific credentials rather than shared admin passwords.
  5. Integrate Cisco NX-OS devices into your SIEM — forward syslogs and enable NX-OS audit logging to capture CLI command execution, including attempts to use the vulnerable commands.
  6. Consider network device configuration scanning (Cisco's Network Assurance Engine or similar) to detect unexpected configuration changes that may indicate compromise.

Key Details

PropertyValue
CVE ID CVE-2024-20399
Vendor / Product Cisco — NX-OS
NVD Published2024-07-01
NVD Last Modified2025-10-28
CVSS 3.1 Score6
CVSS 3.1 VectorCVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
SeverityMEDIUM
CWE CWE-78 find similar ↗
CISA KEV Added2024-07-02
CISA KEV Deadline2024-07-23
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Local
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Required Action

CISA BOD 22-01 Deadline: 2024-07-23. Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.

Timeline

DateEvent
2024-07-01Cisco publishes advisory and patches for CVE-2024-20399 — credits Sygnia with discovery during incident response
2024-07-02CISA adds to Known Exploited Vulnerabilities catalog
2024-07-23CISA BOD 22-01 remediation deadline