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.
git-spawned-stream
Advanced tools
Create a readable stream from a spawned git process.
gitSpawnedStream(repoPath, spawnArguments, limitInBytes, gitBinary)
Arguments:
repoPath
- the path to the repo, ex: /home/alex/node/.git (or the path to the git bare repo)spawnArguments
- the arguments that will be passed to the child_process.spawn
functionlimitInBytes
- kill the process if it exceeds the imposed limit (sends more data than allowed)gitBinary
- path to the git binary to use (use the one in PATH
by default)Example:
var gitSpawnedStream = require('git-spawned-stream');
var path = require('path');
var repoPath = process.env.REPO || path.join(__dirname, '.git');
repoPath = path.resolve(repoPath);
var byteLimit = 5 * 1024 * 1024; // 5 Mb
// sort of a git log -n 2
var stream = gitSpawnedStream(repoPath, [
'rev-list',
'--max-count=2',
'--header',
'HEAD'
], byteLimit);
stream.on('data', function(data) {
console.log('DATA', data.toString('utf8'));
}).on('error', function(err) {
console.error('An error occurred:');
console.error('-----------------\n');
console.error(err.message);
process.exit(1);
}).on('end', function(killed) {
// when the stream is cut, killed === true
console.log("\n±±±±±±±±±±±±±±±±±\nThat's all folks!");
});
MIT
FAQs
Create a readable stream from a spawned git process.
The npm package git-spawned-stream receives a total of 22,785 weekly downloads. As such, git-spawned-stream popularity was classified as popular.
We found that git-spawned-stream 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.