Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Work around memcached's feature of treating expiration times larger than one month as timestamps for Rails cache stores.
This is a memcached documented behaviour:
makes sense... but:
3.000.000 is treated as timestamp, so the key expired at 1970-02-04 17:20:00 (3.000.000 seconds after the UNIX epoch). So when you want to store something with an expiration time larger than a month you have to convert the expiration time to a proper timestamp. This is annoying and it even becomes impossible when you want to set default expiration times on stores.
This gem provides additional cache stores, subclasses of the original ones altering this behaviour for sanity.
Supported cache stores: couchbase_store, dalli_store, mem_cache_store.
The dalli store actually fixed this on version 2.7.1 but it's kinda debated (issue #436) on whether this should stay in as it's a documented memcached "feature" and clients should probably be not alter to these things.
So don't use this if your dalli gem version is >= 2.7.1.
Add this line to your application's Gemfile:
gem 'sane_memcached_ttl'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sane_memcached_ttl
When defining a Rails cache store like:
config.cache_store = :mem_cache_store, "cache-1.example.com", "cache-2.example.com"
just change to:
config.cache_store = :mem_cache_store_with_sane_ttl, "cache-1.example.com", "cache-2.example.com"
Same for all supported stores:
Original store | Sane store |
---|---|
mem_cache_store | mem_cache_store_with_sane_ttl |
dalli_store | dalli_store_store_with_sane_ttl |
couchbase_store | couchbase_store_with_sane_ttl |
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sane_memcached_ttl 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.