GHSA-28xh-wpgr-7fm8
Command Injection in open
- Severity
- Critical
- The publisher's own rating, not a CVSS score
- Exploit chance (EPSS)
- —
- No score published
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
- Fix
6.0.0- Upgrade open to this version or later
Description
Versions of open before 6.0.0 are vulnerable to command injection when unsanitized user input is passed in.
The package does come with the following warning in the readme:
The same care should be taken when calling open as if you were calling child_process.exec directly. If it is an executable it will run in a new shell.
Recommendation
open is now the deprecated opn package. Upgrading to the latest version is likely have unwanted effects since it now has a very different API but will prevent this vulnerability.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| open | < 6.0.0 |
6.0.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
open npm → 6.0.0
- npm
npm install open@6.0.0- yarn
yarn add open@6.0.0- pnpm
pnpm add open@6.0.0
Weakness
CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
How to prevent it
- Architecture and Design: If at all possible, use library calls rather than external processes to recreate the desired functionality.
- Implementation: If possible, ensure that all external commands called from the program are statically created.
- Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- Operation: Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
- System Configuration: Assign permissions that prevent the user from accessing/opening privileged files.
References
Other links
Timeline
- Published
- Last updated by the source
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-587h-7wmj-h5pm launch-editor: `fs.existsSync()` existence check can be bypassed on Windows | High | Same weakness, CWE-77 |
| CVE-2026-96951 Improper neutralization of special elements used in a command ('command injection') in Windows Shell allows an unauthorized attacker to bypass a security… | High Known exploited | Same weakness, CWE-77 |
| CVE-2026-105134 A flaw has been found in Ahsay AhsayCBS up to 9.15.2.69/10.3.4.44. | Critical Known exploited | Same weakness, CWE-77 |
| GHSA-jf24-8g2h-2wg7 LibreNMS Vulnerable to Remote Code Execution via AboutController | High | Same weakness, CWE-77 |
| GHSA-c9fv-cgmm-2wg7 LibreNMS Vulnerable to Remote Code Execution by Signal Alert Transportation module | High | Same weakness, CWE-77 |
| GHSA-6qc3-v8fv-fv9j Apache Ranger has a Command Injection vulnerability | Critical | Same weakness, CWE-77 |
| GHSA-956x-8gvw-wg5v GitPython: command injection via unguarded Git options in `Repo.archive()`, `git.ls_remote()`, and arbitrary file overwrite via `Repo.iter_commits()` / `Repo.blame()` | High | Same weakness, CWE-77 |
| GHSA-qf6p-p7ww-cwr9 Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge | Critical | Same weakness, CWE-77 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor