Executive brief
Clerk's authentication libraries include an optional proxy feature that forwards API requests between frontend and backend systems. An unauthenticated attacker can exploit path manipulation to redirect the proxy to leak secret API keys to attacker-controlled servers, compromising all authentication and authorization functions for affected applications.
Technical details
The clerkFrontendApiProxy function in Clerk's backend SDKs is vulnerable to Server-Side Request Forgery (CWE-918) due to insufficient validation of request paths. An unauthenticated attacker can craft a malicious request path containing double slashes that causes the proxy to forward requests to an attacker-controlled server, leaking the application's Clerk-Secret-Key header. The vulnerability is triggered when the frontendApiProxy feature is explicitly enabled in middleware configuration—it is disabled by default. Attack vector is network-based with high complexity due to path manipulation requirements. An attacker who captures the secret key can forge authentication tokens and impersonate any user in the application.
Affected products
- Clerk backend 3.0.0 through 3.2.2
- Clerk express 2.0.0 through 2.0.6
- Clerk hono 0.1.0 through 0.1.4
- Clerk fastify 3.1.0 through 3.1.4
Timeline
- 2026-03-27: disclosed: Advisory published; discovered during internal code audit
- 2026-03-27: patched: Patches released: @clerk/backend 3.2.3, @clerk/express 2.0.7, @clerk/hono 0.1.5, @clerk/fastify 3.1.5