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.
github.com/tc80/loseless-compression-benchmarker
A simple program to generate the resulting size in bytes for a number of cdnjs files after compressing with an algorithm.
It was developed with Go version 1.14.4 and macOS Catalina 10.15.5.
The application reads from input.txt
, which contains the list of target cdnjs files for compression. Each entry must begin on a new line and prefixed with /ajax/libs/
, corresponding to entries in the cdnjs GitHub repo.
For example:
/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2
More examples can be found in this repo's input.txt.
The application relies on an environment variable CDNJS_PATH
. This variable must contain the path to the local cdnjs GitHub repo after cloning.
For example:
export CDNJS_PATH="/tmp/cdnjs/cdnjs"
Here, /tmp/cdnjs/cdnjs/
will contain the ajax/
directory.
In order for this tool to work, the algorithm must output its result to STDOUT
. This is because this tool focuses on the size of the resulting output, not writing the output itself to a file.
To build, use the Makefile
provided.
Simply run make
to build and make clean
to remove the executable/output directory.
To run the program for an algorithm with n
arguments:
./compress <shell command for algorithm> <algorithm argument 1> ... <algorithm argument n>
For example, to benchmark zopfli -i1000 --gzip
on all libaries in input.txt
, run:
./compress zopfli -c -i1000 --gzip
Note that we added -c
here to ensure the output is written to STDOUT
.
The provided Makefile
contains a number of built-in options.
To run all of them at once:
make run
This will generate a number of csv files in the output/
directory.
FAQs
Unknown package
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.