# CVE-2021-23358: Arbitrary Code Injection

> Attackers can execute arbitrary code via the template function in the Underscore.js library when unsanitized variable properties are passed as arguments.

- **Severity:** Low 3.3 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:N/E:P/RL:O/RC:C`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Mar 2021
- **Updated:** 3 Nov 2025
- **Also known as:** AZL-45222, CLSA-2026-1775003188, CLSA-2026-1775003190, DEBIAN-CVE-2021-23358, DLA-2613-1, DSA-4883-1, GHSA-cf4h-3jhx-xvhq, MGASA-2021-0269, OESA-2021-1174, ROOT-APP-NPM-CVE-2021-23358, UBUNTU-CVE-2021-23358, USN-4913-1, openSUSE-SU-2021:0601-1, openSUSE-SU-2024:11095-1

## What is CVE-2021-23358?

CVE-2021-23358 is a low-severity code injection vulnerability in Debian Debian Linux, published on 29 Mar 2021. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

The package underscore from 1.13.0-0 and before 1.13.0-2, from 1.3.2 and before 1.12.1 are vulnerable to Arbitrary Code Injection via the template function, particularly when a variable property is passed as an argument as it is not sanitized.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2021-23358?

2 open source packages ship an affected version, including underscore. It affects 4 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `underscore` | npm | From 1.3.2 | 1.12.1 |
| `underscore` | npm | From 1.3.2 | 1.12.1 |
| `nodejs-underscore` | openSUSE:Leap 15.2 | All versions | 1.13.1-lp152.4.3.1 |
| `nodejs-underscore` | openSUSE:Tumbleweed | All versions | 1.13.1-1.3 |

Products: Debian Debian Linux, Fedoraproject Fedora, Tenable Tenable.sc, Underscorejs Underscore.

## How do I fix CVE-2021-23358?

Upgrade underscore to 1.12.1 or later.

## Is CVE-2021-23358 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-23358 exists.

Public exploit code:

- Detection script for cve-2021-23358 (github_poc): https://github.com/EkamSinghWalia/Detection-script-for-cve-2021-23358
- https://github.com/MehdiBoukhobza/SandBox_CVE-2021-23358 (github_poc): https://github.com/MehdiBoukhobza/SandBox_CVE-2021-23358

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-23358 and fix it if it is affected.

What it is: CVE-2021-23358 is a low-severity code injection vulnerability in Debian Debian Linux, published on 29 Mar 2021. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-23358 exists.

Affected packages and fixed versions:
- underscore (npm): affected from 1.3.2; fixed in 1.12.1
- underscore (npm): affected from 1.3.2; fixed in 1.12.1

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-2021-23358/ (Markdown: https://insights.sbomify.com/CVE-2021-23358/index.md)
```

## Sources

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

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