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.
localcookie
Advanced tools
A localStorage implementation in a cookie
Loosly based on https://github.com/ivpusic/angular-cookie
Use it in browser libs where you want to store session tokens and the like in the cookie instead of in localStorage. So that you can store things across multiple subdomains.
var localStorage = require('localcookie')
, myValue = { foo: 'bar', baz: 'quux' }
;
localStorage.config({expires: 21, domain: '.mydomain.com'});
localStorage.setItem('myKey', JSON.stringify(myValue));
myValue = localStorage.getItem('myKey');
domain: 'example.com'
The domain tells the browser to which domain the cookie should be sent. If you don't specify it, it becomes the domain of the page that sets the cookie.
path: '/'
The path gives you the chance to specify a directory where the cookie is active.
expires: 21
Each cookie has an expiry date after which it is trashed. If you don't specify the expiry date the cookie is trashed when you close the browser.
expirationUnit: 'minutes'
Allows you to set the expiration time in hours
, minutes
or seconds
.
If this is not specified, any expiration time specified will default to days.
secure: true
The Secure attribute is meant to keep cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections.
Only strings as values
npm install
grunt
npm test
FAQs
localStore emulated in a cookie
The npm package localcookie receives a total of 0 weekly downloads. As such, localcookie popularity was classified as not popular.
We found that localcookie 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.