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.
Requires the redis gem. Including this in your project will give you additional locking abilities on any instance of a redis connection you create.
gem install redis-lock
require 'redis'
require 'redis-lock # This will automatically include Lock into the Redis class.
Here's a little example of what you can do with it:
timeout = 10 # measured in seconds
max_attempts = 100 # number of times the action will attempt to lock the key before raising an exception
$redis = Redis.new
$redis.lock('beers_on_the_wall', timeout, max_attempts)
# Now no one can acquire a lock on 'beers_on_the_wall'
$redis.unlock('beers_on_the_wall')
# Other processes can now acquire a lock on 'beers_on_the_wall'
For convenience, there is also a lock_with_update
function that accepts a block. It handles the locking and unlocking for you.
$redis.lock_for_update('beers_on_the_wall') do
$redis.multi do
$redis.set('sing', 'take one down, pass it around.')
$redis.decr('beers_on_the_wall')
end
end
This gem basically implements the algorithm described here: http://redis.io/commands/setnx
Patrick Tulskie; http://patricktulskie.com
FAQs
Unknown package
We found that jashmenn-redis-lock 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.