CVE-2021-23358 is an arbitrary code-injection vulnerability in the Underscore.js template function. In affected versions, the variable option is incorporated into dynamically generated JavaScript without sufficient sanitization. An attacker able to control this property can inject JavaScript into the generated template function. Affected versions are 1.3.2 through versions before 1.12.1, and 1.13.0-0 through versions before 1.13.0-2.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
variable property. Where upgrading cannot occur immediately, restrict the property to a validated JavaScript identifier under a strict allowlist and prevent untrusted users from controlling template compilation options. No complete vendor-provided workaround is available.Patch, then assume compromise.
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos (1 hidden).
This repository contains a working exploit for CVE-2021-23358, a code injection vulnerability in the 'underscore' Node.js library. The main files of interest are: - **app.js**: A Node.js Express web application that demonstrates the vulnerability. It exposes a web form at `http://localhost:3000/` with two inputs. The first input (`input1`) is processed unsafely by assigning its value to `_.templateSettings.variable`, leading to code injection if a malicious payload is supplied. The second input is sanitized. - **exploitCVE.py**: An automated exploit script written in Python. It uses Selenium to interact with the vulnerable web form, injects a payload into the vulnerable input field, and submits the form. The default payload opens a reverse shell to the attacker's machine, but a custom payload can also be specified. - **cve-2021-23358.sh**: A detection script that checks for vulnerable versions of the 'underscore' library on the system, both via npm and by searching the filesystem. The exploit demonstrates remote code execution by leveraging the vulnerable input field in the web application. The attacker can use the provided Python script to automate exploitation, specifying the target URL, input field ID, and payload. The repository also includes a detection script to help identify vulnerable installations of the 'underscore' library. The main attack vector is via a web form exposed by a Node.js application using a vulnerable version of 'underscore'. The exploit is operational and provides a real payload (reverse shell), making it suitable for demonstrating the impact of the vulnerability.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
9 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
An arbitrary code execution vulnerability in nodejs-underscore via the template function.
An arbitrary code-execution vulnerability in the nodejs-underscore template function, fixed by updated ovirt-engine packages.
An arbitrary code execution vulnerability in the nodejs-underscore template function, addressed by the RHV Manager (ovirt-engine) security update.
An arbitrary code-execution vulnerability in the nodejs-underscore template function, fixed in Red Hat Advanced Cluster Management for Kubernetes 2.2.3 release images.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.