Snyk Vulnerability: Command Injection through `shelljs`
See original GitHub issueπ bug report
Affected Package
The issue is caused by package shelljs which is a dependency for @angular/compiler-cliSeverity
CVSS SCORE 7.0 High SeverityDescription
Shelljs is vulnerable to Command Injection. It is possible to invoke commands from shell.exec() from external sources, allowing an attacker to inject arbitrary commands.π Your Environment
Angular Version:
Angular CLI: 7.3.6
Node: 10.13.0
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.13.6
@angular-devkit/core 7.3.6
@angular-devkit/schematics 7.3.6
@schematics/angular 7.3.6
@schematics/update 0.13.6
rxjs 6.3.3
typescript 3.2.4
Anything else relevant?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Command Injection in shelljs - Snyk
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quickΒ ......
Read more >Error message: Shelljs 0.8.3 and before are vulnerable to ...
3 and before are vulnerable to Command Injection. Commands can be invoked from shell.exec(), those commands will include input from externalΒ ...
Read more >Mining Node.js Vulnerabilities via Object Dependence Graph ...
js vulnerabilities, such as command injection and prototype pollution, but they are spe- cific to individual vulnerability and do not generalizeΒ ...
Read more >1425807 β nodejs-shelljs: Command injection via shell.exec() call
shelljs is a portable Unix shell commands for Node.js. It is possible to invoke commands from shell.exec() from external sources, allowing an attacker...
Read more >shelljs @ 0.8.0 .. 0.8.1 - Package Diff
+- Snyk vulnerability DB reporting command injection vulnerability in ShellJS [\#810](https://github.com/shelljs/shelljs/issues/810).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This really doesnβt seem like a vulnerability in shelljs either. The functionality provided by the βexecβ call is intended to allow an application using the library to execute an arbitrary command. If an application doesnβt sanitize input before calling then the application itself has the security vulnerability not the library. If this were not the case then Nodejs itself would have the same security vulnerability report since it also provides the same functionality (which this library actually uses to implement its functionality).
Hi all, I work on ShellJS.
I think you misunderstood. This is not a fix, itβs my project to implement a feature request. Landing that PR will not βfixβ the βvulnerability.β I acknowledge I havenβt provided a timeline for the feature: my time for ShellJS is very limited and must balance feature work with other work for the module. As such, I have no clue when I can finish that feature, or if a satisfactory solution is even technically feasible.
I agree with what the Angular team has expressed on this thread. The resolution should be for Snyk and similar services to remove this false positive and flag modules which misuse
shell.exec()
/child_process.exec()
, rather than flagging ShellJS itself (we canβt βfixβexec()
, we just hope to eventually deprecate it).Weβve spent years working to get the semantics right for these bash commands, and are still working hard to get proper coverage/behavior. Rewriting from scratch would probably introduce a lot of deviations from the POSIX behavior (and copy-paste might create license issues). So, while I canβt stop folks from doing this, I would strongly advise against adding error-prone implementations to replace existing solutions.
Thanks for reaching out @SanderElias! Reading the quoted response, it might be misinterpreted as Snyk is waiting on action from me. My last communication with them was prior to your comment, but they said they need no action from ShellJS or me and theyβre not currently ready to take down this vulnerability report. But Iβm happy to help out within reason if they need further action from ShellJS.