Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Parsing and quoting for shell command lines that supports both bash and windows styles of quoting.
A simple set of functions for parsing a command line string into arguments and converting command line arguments into a correctly escaped string.
Many other npm modules offer this functionality however the only ones I could find only support unix style escaping and so do not work correctly for windows command lines.
This module exports bashShellParse
, winShellParse
, bashShellQuote
and winShellQuote
. It
also exports shellQuote
and shellParse
which call the function correct for the current platform.
The parse functions accept a string and return an array of strings:
import { bashShellQuote } from "shell-args";
bashShellParse("hello there world"); // -> ["hello", "there", "world"]
bashShellParse("\"hello there\" world"); // -> ["hello there", "world"]
bashShellParse(`foo
test\\(\\)`); // -> ["foo", "test()"]
The quote functions accept an array of strings and return a string:
import { bashShellParse } from "shell-args";
bashShellQuote(["hello", "there", "world"]); // -> "hello there world"
bashShellQuote(["hello there", "world"]); // -> "\"hello there\" world"
bashShellQuote(["foo", "test()"]); // -> ["foo", "test\\(\\)"]
FAQs
Parsing and quoting for shell command lines that supports both bash and windows styles of quoting.
The npm package shell-args receives a total of 542 weekly downloads. As such, shell-args popularity was classified as not popular.
We found that shell-args demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.