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.
permissive-cors
Advanced tools
Allows CORS for Node HTTP in the most permissive way.
Any specific headers or HTTP verbs requested by client calls via Access-Control-Request-Method or Access-Control-Request-Headers will be automatically added to the corresponding response headers. In other words, this middleware ALLOWS ALL THE THINGS.
npm install permissive-cors
Example using Express:
var express = require('express');
var app = express();
var cors = require('permissive-cors');
app.use(cors());
app.put('/', function (req, res) {
//...
});
app.delete('/', function (req, res) {
//...
});
Example using Node HTTP:
var http = request('http');
var cors = require('permissive-cors');
var corsMiddleware = cors();
http.createServer(function (req, res) {
corsMiddleware(req, res, function onDone() {
// your code here
res.end();
});
});
Run npm test
Tested in Chrome 36, Safari 7 and Firefox 30. For any bugs found, feel free to submit a PR.
FAQs
CORS for Node HTTP in the most permissive way
We found that permissive-cors 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.