Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ekit-cross-site
Advanced tools
You may face the problem with Access-Control-Allow-Origin when you want to call API on cross domain. Here is the simple solution for that.
Require ekit-cross-site module before all other API defination and put the list of allow site as below
Note: only use with expressjs
...
var app = express();
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
...
});
require('ekit-cross-site')(app, ['http://127.0.0.1:9000', 'http://0.0.0.0:9000']);
...
var config = {
allow: ['http://127.0.0.1:9000', 'http://0.0.0.0:9000']
};
module.exports = function(app, allowList) {
// allow
config.allow = allowList;
// allow request
app.all('/*', function(req, res, next) {
var isPass = false;
for (var i in config.allow) {
if (req.headers.origin === config.allow[i]) {
isPass = true;
}
};
if (isPass === true) {
res.header('Access-Control-Allow-Origin', req.headers.origin);
res.header('Access-Control-Allow-Methods', '*');
res.header('Access-Control-Allow-Headers', 'Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept');
};
return next();
});
}
FAQs
ekit package, support cross site manager
We found that ekit-cross-site 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.