
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.
This is a simple Ruby gem for in-memory caching. Read this blog post to understand what Zache is designed for.
First, install it:
gem install zache
Then, use it like this:
require 'zache'
zache = Zache.new
# Expires in 5 minutes
v = zache.get(:count, lifetime: 5 * 60) { expensive_calculation() }
If you omit the lifetime
parameter, the key will never expire.
By default Zache
is thread-safe. It locks the entire cache on each
get
call. You can turn that off by using the sync
argument:
zache = Zache.new(sync: false)
v = zache.get(:count) { expensive_calculation() }
You may use "dirty" mode, which will return an expired value while
calculation is in progress. For example, if you have a value in the cache that's
expired, and you call get
with a long-running block, the thread waits.
If another thread calls get
again, that second thread won't wait, but will
receive the expired value from the cache. This is a very convenient mode for situations
where absolute data accuracy is less important than performance:
zache = Zache.new(dirty: true)
# Or enable dirty mode for a specific get call
value = zache.get(:key, dirty: true) { expensive_calculation() }
The entire API is documented here. Here are some additional useful methods:
# Check if a key exists
zache.exists?(:key)
# Remove a key
zache.remove(:key)
# Remove all keys
zache.remove_all
# Remove keys that match a condition
zache.remove_by { |key| key.to_s.start_with?('temp_') }
# Clean up expired keys
zache.clean
# Check if cache is empty
zache.empty?
Read these guidelines. Make sure your build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:
bundle update
bundle exec rake
If it's clean and you don't see any error messages, submit your pull request.
FAQs
Unknown package
We found that zache demonstrated a healthy version release cadence and project activity because the last version was released less than 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.