
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
safe-read-write
Advanced tools
Uses lockfile and mz (mz/fs) to write and read simple text files safely
Uses lockfile and mz to safely read and write simple text files.
Use case: Needed for a node based http server application that does many small read/write operations. The server accepts requests and returns a 202 - Accepted
. The server contains a worker process that is executed using spawn that does a potenaillay long (up to many minutes) process; during the process, the worker writes status information in JSON to a file. The client then polls for the status could get malformed JSON without safe-read-write.
Install, develop, test, use
# install
npm install safe-read-write
# develop
npm run compile
npm run dev # watch
# test
npm test
npm run tdd # watch
# use
const saferw = require('safe-read-write');
import saferw from 'safe-read-write';
...
safeWrite('/path/to/textfile', 'text content', 'utf8');
...
safeRead('/path/to/textfile')
.then(data => ...);
FAQs
Uses lockfile and mz (mz/fs) to write and read simple text files safely
We found that safe-read-write 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.