
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.
@schibsted/middy-cors
Advanced tools
Middy middleware for adding CORS headers to success response and errors
This middleware sets HTTP CORS headers, necessary for making cross-origin requests, to the response object.
Sets headers in after
and onError
phases.
This is an alternative to standard Middy cors handler with the following differences:
To install this middleware you can use NPM:
npm install --save @schibsted/middy-cors
allowedOrigins
(array) - list of allowed origins or ['*']
for allowing all originsexposeHeaders
(array) - list of headers to exposemaxAge
(string) - value passed to access-control-max-age
headercredentials
(bool) - value passed to access-control-allow-credentials
headerallowMethods
(array) - list of allowed HTTP methodsallowHeaders
(array) - list of allowed HTTP headersconst middy = require('@middy/core');
const cors = require('@schibsted/middy-cors');
const handler = middy(async () => ({
statusCode: 200,
body: JSON.stringify({ foo: 'bar' }),
}));
handler
.use(cors({ allowedOrigins: ['https://www.vg.no', 'https://www.tek.no']}));
// when Lambda runs the handler...
handler({}, {}, (_, response) => {
expect(response).toEqual({
statusCode: 200,
headers: {
'access-control-allow-origin': 'https://www.vg.no',
},
body: JSON.stringify({ foo: 'bar' }),
})
})
Everyone is very welcome to contribute to this repository. Feel free to raise issues or to submit Pull Requests.
3.0.1 (2022-08-29)
FAQs
Middy middleware for adding CORS headers to success response and errors
The npm package @schibsted/middy-cors receives a total of 4 weekly downloads. As such, @schibsted/middy-cors popularity was classified as not popular.
We found that @schibsted/middy-cors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.