Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
heap-snapshot-sanitizer
Advanced tools
Stream transform implementation to sanitize heap snapshot.
Stream transform implementation to sanitize heap snapshot.
This is to redact sensitive data in the heap snapshots.
All strings which are not name of nodes
or edges
are obfuscated.
Heap-snapshots are helpful to diagnose memory leaks. One reason they are discouraged in production is that they can contain sensitive data like PII. Obfuscating strings in the heap-snapshot tries to remediate this.
...
const Sanitizer = require('heap-sanpshot-santizer');
...
const session = new inspector.Session();
const fstrm = fs.createWriteStream(filename);
const sanitizer = new Sanitizer(/*options*/);
session.connect();
sanitizer.pipe(fstrm);
fstrm.on('error', (e) => {
// console.error(e);
});
sanitizer.on('error', (e) => {
// console.error(e);
});
sanitizer.on('end', function() {
sanitizer.unpipe();
// fstrm.end(); // unpipe should end the filestream
});
session.on('HeapProfiler.addHeapSnapshotChunk', (m) => {
sanitizer.write(m.params.chunk);
sanitizer.resume();
});
session.post('HeapProfiler.takeHeapSnapshot', null, (err, r) => {
// console.log('Runtime.takeHeapSnapshot done:', err, r);
session.disconnect();
sanitizer.end();
});
...
useWorkerThread
: {Boolean} Default is false
. The chunk is processed in the worker thread.
Node.js clones the chunk while passing it over to the worker thread.FAQs
Stream transform implementation to sanitize heap snapshot.
The npm package heap-snapshot-sanitizer receives a total of 6 weekly downloads. As such, heap-snapshot-sanitizer popularity was classified as not popular.
We found that heap-snapshot-sanitizer 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.