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.
reversible-preproc-cli
Advanced tools
reversible-preproc-cli
is a command line interface on top of the
npm core module
reversible-preproc
.
The preproc defines are supplied as a file input, or on the command line.
This differs from, for example, C, where the defines are
inscribed in the file to be processed. The defines uses a Javascript style format
allowing structured properties and values. E.g.,
{
DEBUG: 2,
select : 1,
configs : [{
A: 1, B: 2
}, {
A: 2, B: 3
}]
}
The file to processed of course contains conditional statements (conditioned on the defines).
These conditional statements may be written in either of two styles:
The Psuedo Javascript is briefer and more natural, but the Real Javascript is almighty.
For more details about the defines and the conditional statements, see the documentation for reversible-preproc on npm or github.
The "reversible" moniker indicates that it is suitable for lightweight switching back and forth between configuations (e.g., in-place). The deactivated regions are marked with annotated comments (//!!) enabling the preprocessor to remove them for a different configuration. Repeated applications of the same defines are idempotent.
Regexp is not used. Neither is all text searched. Only lines beginning with comment marks (e.g. //), are further processed as potential processing command lines. This makes processing relatively fast.
The rest of this document describes the CLI arguments.
-i --infile The file to be transformed. If omitted stdin will be used.
-o --outfile The file to which to write the transformed data. If omitted stdout will be used.
-f --deffile The file containing the JSON variable properties.
-l --defline To pass the JSON defines inline. Due to the need to escape quotations marks this option is only usefule for simple cases.
-t --testout Instead of outputting the transformed input, the output contains one line for conditional statement with the form: <T or F> <the conditional statement>
NOTE: Only one, and exactly one, of the '--deffile' and '--defline' options can/must be used.
FAQs
CLI for reversible-preproc
The npm package reversible-preproc-cli receives a total of 1 weekly downloads. As such, reversible-preproc-cli popularity was classified as not popular.
We found that reversible-preproc-cli 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.