Ivanti Connect Secure Authenticated Command Injection (CVE-2024-21887)
CVE-2024-21887 is a critical authenticated command injection vulnerability (CVSS 9.1) in Ivanti Connect Secure and Policy Secure web components. When chained with the authentication bypass CVE-2023-46805, unauthenticated remote attackers can execute arbitrary commands on the appliance as root. Nation-state threat actors (UNC5221) exploited this as a zero-day to deploy LIGHTWIRE, WIREFIRE, and FRAMESTING web shells and conduct credential harvesting and lateral movement. CISA added this to the KEV catalog in January 2024.
Vulnerability Intelligence
KEV — Known ExploitedAffected Software
- Vendor
- Ivanti
- Product
- Connect Secure, Policy Secure
- Versions
- Ivanti Connect Secure 9.x and 22.x, Ivanti Policy Secure 9.x and 22.x
Weakness (CWE)
Timeline
- Disclosed
- January 12, 2024
References & Proof of Concept
- https://nvd.nist.gov/vuln/detail/CVE-2024-21887
- https://forums.ivanti.com/s/article/CVE-2023-46805-Authentication-Bypass-CVE-2024-21887-Command-Injection-for-Ivanti-Connect-Secure-and-Ivanti-Policy-Secure-Gateways
- https://www.mandiant.com/resources/blog/suspected-apt-targets-ivanti-zero-day
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-060b
CVSS
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
What is CVE-2024-21887 Ivanti Connect Secure Authenticated Command Injection (CVE-2024-21887)?
Ivanti Connect Secure Authenticated Command Injection (CVE-2024-21887) (CVE-2024-21887) maps to the Initial Access and Execution and Persistence and Credential Access and Lateral Movement tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for Ivanti Connect Secure Authenticated Command Injection (CVE-2024-21887), covering the data sources and telemetry it touches: CommonSecurityLog, W3CIISLog, AzureDiagnostics, Syslog. The queries below are rated critical severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
let ivanti_paths = dynamic(['/api/v1/totp/user-backup-code/', '/api/v1/system/maintenance/archiving/cloud-server-test-connection', '/api/v1/configuration/users/user-roles/user-role/', '/api/v1/license/keys-status/']);
let suspicious_methods = dynamic(['POST', 'PUT', 'GET']);
union CommonSecurityLog, W3CIISLog, AzureDiagnostics
| where TimeGenerated >= ago(7d)
| where DeviceProduct has_any ('Ivanti', 'Pulse Secure', 'PCS') or csUriStem has_any ('/dana-ws/', '/dana-admin/', '/dana/', '/api/v1/')
| where (
(csUriStem matches regex @'/api/v1/[a-z\-/]+' and csMethod in (suspicious_methods)) or
(csUriStem has '/totp/user-backup-code') or
(csUriStem has 'archiving/cloud-server-test-connection') or
(csUriStem has 'maintenance')
)
| extend RequestPath = coalesce(csUriStem, RequestUri, Column7)
| extend SourceIP = coalesce(cIP, c_ip, CallerIpAddress, SourceIP)
| extend ResponseCode = coalesce(sc_status, csStatus, toint(ResultCode))
| extend CommandInjectionIndicators = case(
RequestPath matches regex @'[;|&`$(){}\[\]]', 'Shell metacharacters in path',
RequestPath matches regex @'%3[Bb2Cc7c8Ee]', 'URL-encoded shell metacharacters',
RequestPath has_any('wget', 'curl', 'bash', 'sh', 'python', 'perl', 'nc', 'ncat', 'chmod', 'base64'), 'Command in path',
''
)
| where ResponseCode in (200, 201, 204) or isnotempty(CommandInjectionIndicators)
| project TimeGenerated, SourceIP, RequestPath, ResponseCode, CommandInjectionIndicators, csUserAgent, DeviceProduct
| order by TimeGenerated desc Detects exploitation of CVE-2024-21887 by monitoring Ivanti Connect Secure and Policy Secure appliance API endpoints for authenticated command injection patterns. Looks for suspicious API path access, shell metacharacters, encoded payloads, and known vulnerable endpoint patterns in web logs.
Data Sources
Required Tables
False Positives
- Legitimate administrative API calls to Ivanti management endpoints during maintenance windows
- Automated vulnerability scanners performing routine scans against the appliance
- Penetration testing or red team exercises targeting the Ivanti infrastructure
- Health monitoring tools polling Ivanti API status endpoints
Sigma rule & cross-platform mapping
The detection logic for Ivanti Connect Secure Authenticated Command Injection (CVE-2024-21887) (CVE-2024-21887) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
product: azure Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2024-21887
References (5)
- https://nvd.nist.gov/vuln/detail/CVE-2024-21887
- https://forums.ivanti.com/s/article/CVE-2023-46805-Authentication-Bypass-CVE-2024-21887-Command-Injection-for-Ivanti-Connect-Secure-and-Ivanti-Policy-Secure-Gateways
- https://www.mandiant.com/resources/blog/suspected-apt-targets-ivanti-zero-day
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-060b
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1CVE-2024-21887 Command Injection via TOTP Backup Code Endpoint
Expected signal: HTTP POST to /api/v1/totp/user-backup-code/ with shell metacharacters in request body, followed by file creation event in /tmp/ visible in process audit logs
- Test 2CVE-2023-46805 + CVE-2024-21887 Full Chain — Unauthenticated RCE
Expected signal: Sequence of: GET to /dana-na/auth/saml-sso.cgi with path traversal, 200 response with session cookie, then PUT to /api/v1/system/maintenance/archiving/cloud-server-test-connection with shell metacharacters in host field, followed by outbound HTTP callback from appliance
- Test 3Post-Exploitation Web Shell Deployment Simulation
Expected signal: File creation event at /home/webserver/htdocs/dana-na/auth/ for a new .pl or .py file; subsequent GET request to that file path with query parameters (cmd=, exec=, c=); process spawning by the web server daemon executing perl or python
- Test 4Credential Harvesting Simulation via Ivanti Config API
Expected signal: GET requests to Ivanti configuration API endpoints for user-roles and authentication server configuration; successful 200 responses containing credential or LDAP bind DN data
Unlock Pro Content
Get the full detection package for CVE-2024-21887 including response playbook, investigation guide, and atomic red team tests.