
Research
Using Trusted Protocols Against You: Gmail as a C2 Mechanism
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
nextjs-edge-cors
Advanced tools
The easiest way to enable CORS is in your Next config, per the [docs](https://vercel.com/guides/how-to-enable-cors):
The easiest way to enable CORS is in your Next config, per the docs:
// next.config.mjs
export const headers = () => {
return [
{
source: "/api/cors/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" },
]
}
];
};
Alternatively, you can use the withCors()
Middleware wrapper:
// src/middleware.ts
import { withCors } from "nextjs-edge-cors"
export const middleware = withCors();
export const config = {
matcher: ["/api/cors/:path*"]
};
You can wrap existing Middleware or pass CORS options to withCors()
:
import { withCors } from "nextjs-edge-cors"
export const middleware = withCors(
otherMiddleware,
{
/**
* Only allow CORS requests from Google.com. Comma separate for multiple
* values.
*/
origin: "https://www.google.com"
}
);
export const config = {
matcher: ["/api/cors/:path*"]
};
FAQs
The easiest way to enable CORS is in your Next config, per the [docs](https://vercel.com/guides/how-to-enable-cors):
The npm package nextjs-edge-cors receives a total of 7 weekly downloads. As such, nextjs-edge-cors popularity was classified as not popular.
We found that nextjs-edge-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
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.