
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
@clerk/edge
Advanced tools
This package has been deprecated in favor of the isomorphic @clerk/backend
which is now used across all server-enabled Clerk packages. This package will not receive any future updates. It should not be used directly - please use as a reference only.
This package is a wrapper around Clerk core capabilities with added functionality and helpers aimed towards different edge and serverless platforms.
npm install @clerk/edge
To build the package locally with the TypeScript compiler, run:
npm run build
Currently supported environments/platforms:
To use with Edge Functions:
import { withAuth } from '@clerk/edge/vercel-edge';
async function handler(req, event) {
// ...
}
export const middleware = withAuth(handler);
Supported methods:
withAuth
verifySessionToken
ClerkAPI
Clerk's JWT session token, contains the azp
claim, which equals the Origin of the request during token generation. You can provide the middlewares with a list of whitelisted origins to verify against, to protect your application of the subdomain cookie leaking attack.
Example implementation:
import { withAuth } from '@clerk/edge/vercel-edge';
const authorizedParties = ['http://localhost:3000', 'https://example.com'];
async function handler(req, event) {
// ...
}
export const middleware = withAuth(handler, { authorizedParties });
For further details and examples, please refer to our Documentation.
You can get in touch with us in any of the following ways:
We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines.
@clerk/edge
follows good practices of security, but 100% security cannot be assured.
@clerk/edge
is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the MIT license.
See LICENSE for more information.
FAQs
Clerk SDK for serverless and edge environments
The npm package @clerk/edge receives a total of 329 weekly downloads. As such, @clerk/edge popularity was classified as not popular.
We found that @clerk/edge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.