# CVE-2024-21887: Ivanti Connect Secure and Policy Secure Command Injection

> An authenticated administrator can execute arbitrary commands on Ivanti Connect Secure and Policy Secure appliances via crafted web requests.

- **Severity:** Critical 9.1 (`CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 10 Jan 2024 (CISA KEV), used in ransomware
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 12 Jan 2024
- **Updated:** 4 Aug 2026
- **Also known as:** GHSA-87qj-c5f7-6c8q

## What is CVE-2024-21887?

CVE-2024-21887 is a critical command injection vulnerability in Ivanti Connect Secure, published on 12 Jan 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

A command injection vulnerability in web components of Ivanti Connect Secure (9.x, 22.x) and Ivanti Policy Secure (9.x, 22.x)  allows an authenticated administrator to send specially crafted requests and execute arbitrary commands on the appliance.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2024-21887?

It affects 2 products.


Products: Ivanti Connect Secure, Ivanti Policy Secure.

## How do I fix CVE-2024-21887?

No fix has been published for CVE-2024-21887 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 22 Jan 2024.

## Is CVE-2024-21887 being exploited?

Yes. Attackers have exploited CVE-2024-21887 in the wild since at least 10 Jan 2024, including in ransomware campaigns.

Public exploit code:

- A command injection vulnerability in web components of Ivanti Connect Secure (9.x, 22.x) and Ivanti Policy Secure (9.x, 22.x) allows an authenticated administrator to send specially crafted requests and execute arbitrary commands on the appliance. (github_poc): https://github.com/Chocapikk/CVE-2024-21887
- An authentication bypass vulnerability in the web component of Ivanti ICS 9.x, 22.x and Ivanti Policy Secure allows a remote attacker to access restricted resources by bypassing control checks. (github_poc): https://github.com/duy-31/CVE-2023-46805_CVE-2024-21887
- Mitigation validation utility for the Ivanti Connect Around attack chain. Runs multiple checks. CVE-2023-46805, CVE-2024-21887. (github_poc): https://github.com/seajaysec/Ivanti-Connect-Around-Scan
- POC Checker for ivanti CVE-2024-21887 Command injcetion (github_poc): https://github.com/oways/ivanti-CVE-2024-21887
- A Python script for examining Ivanti Secure Connect (ICS) event logs, designed to support investigations into vulnerabilities CVE-2025-0282, CVE-2023-46805, and CVE-2024-21887. (github_poc): https://github.com/Hexastrike/Ivanti-Connect-Secure-Logs-Parser
- The script in this repository only checks whether the vulnerabilities specified in the Ivanti Connect Secure product exist. (github_poc): https://github.com/raminkarimkhani1996/CVE-2023-46805_CVE-2024-21887

## Other vulnerabilities in Ivanti Connect Secure

- [CVE-2021-22893](https://insights.sbomify.com/CVE-2021-22893/): Ivanti Pulse Connect Secure Use-After-Free (critical 10.0, exploited in the wild)
- [CVE-2019-11510](https://insights.sbomify.com/CVE-2019-11510/): Ivanti Pulse Connect Secure Arbitrary File Read (critical 9.9, exploited in the wild)
- [CVE-2025-22457](https://insights.sbomify.com/CVE-2025-22457/): Ivanti Connect Secure, Policy Secure, and ZTA Gateways Stack-Based Buffer Overflow (critical 9.0, exploited in the wild)
- [CVE-2025-0282](https://insights.sbomify.com/CVE-2025-0282/): Ivanti Connect Secure, Policy Secure, and ZTA Gateways Stack-Based Buffer Overflow (critical 9.0, exploited in the wild)
- [CVE-2021-22894](https://insights.sbomify.com/CVE-2021-22894/): Ivanti Pulse Connect Secure Collaboration Suite Buffer Overflow (high 8.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-21887 and fix it if it is affected.

What it is: CVE-2024-21887 is a critical command injection vulnerability in Ivanti Connect Secure, published on 12 Jan 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2024-21887 in the wild since at least 10 Jan 2024, including in ransomware campaigns.

Affected product: Ivanti Connect Secure. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-21887/ (Markdown: https://insights.sbomify.com/CVE-2024-21887/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-21887
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-21887
- OSV: https://osv.dev/vulnerability/CVE-2024-21887

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-21887/
Summaries are generated and may contain mistakes; the official description above is the record.
