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/cyrusaf/workerpool
Package workerpool provides a generic workerpool implementation with basic features such as graceful shutdown and optionally dropping jobs instead of blocking when the queue is full. See the godoc page for full documenation.
func main() {
ctx := context.Background()
wp := workerpool.WorkerPool{
NumWorkers: 2,
QueueSize: 10,
}
wp.Start(ctx) // Spawn worker goroutines and begin processing jobs
var counter uint64 = 0 // Create counter to keep track of jobs run
for i := 0; i < 5; i++ {
// Enqueue job onto workerpool's job queue
wp.Enqueue(func(ctx context.Context) {
atomic.AddUint64(&counter, 1) // Increment counter
})
}
// Gracefully shutdown workerpool, waiting for all queued jobs to finish
wp.Shutdown()
fmt.Println(counter)
// Output: 5
}
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.