Summary
Two critical security vulnerabilities exist in the authentication layer:
-
Hardcoded JWT Secret (src/middleware/authMiddleware.js:3): The JWT signing secret is hardcoded as "jwt_secret_key" in source code. Anyone with repo access can forge valid tokens and bypass authentication entirely.
-
Authentication Bypass (server.js:716-738): The requireSupabaseAuth middleware skips JWT verification when SUPABASE_JWT_SECRET is not set. An attacker can send any arbitrary Bearer token and the request is accepted without cryptographic validation.
Steps to reproduce
- Start the server without setting
SUPABASE_JWT_SECRET environment variable
- Send a POST request to
/process-from-url with header Authorization: Bearer any-random-string
- The request is accepted and processed without valid JWT verification
Expected behavior
The server should reject requests with invalid or missing JWT tokens, even when SUPABASE_JWT_SECRET is not configured. The hardcoded JWT secret should be read from environment variables, not source code.
Actual behavior
When SUPABASE_JWT_SECRET is not set, the middleware accepts any Bearer token without verification. The hardcoded JWT secret is committed to the repository, making it accessible to anyone with read access.
Additional context
- Severity: Critical (CVSS 9.1 - Network/Low/None/Changed/High/High)
- CWE: CWE-798 (Use of Hard-coded Credentials), CWE-287 (Improper Authentication)
- Affected files:
src/middleware/authMiddleware.js, server.js
GSSoC '26 Assignment Request
"I'd like to work on this — contributing under GSSoC'26"
Summary
Two critical security vulnerabilities exist in the authentication layer:
Hardcoded JWT Secret (
src/middleware/authMiddleware.js:3): The JWT signing secret is hardcoded as"jwt_secret_key"in source code. Anyone with repo access can forge valid tokens and bypass authentication entirely.Authentication Bypass (
server.js:716-738): TherequireSupabaseAuthmiddleware skips JWT verification whenSUPABASE_JWT_SECRETis not set. An attacker can send any arbitrary Bearer token and the request is accepted without cryptographic validation.Steps to reproduce
SUPABASE_JWT_SECRETenvironment variable/process-from-urlwith headerAuthorization: Bearer any-random-stringExpected behavior
The server should reject requests with invalid or missing JWT tokens, even when
SUPABASE_JWT_SECRETis not configured. The hardcoded JWT secret should be read from environment variables, not source code.Actual behavior
When
SUPABASE_JWT_SECRETis not set, the middleware accepts any Bearer token without verification. The hardcoded JWT secret is committed to the repository, making it accessible to anyone with read access.Additional context
src/middleware/authMiddleware.js,server.jsGSSoC '26 Assignment Request
"I'd like to work on this — contributing under GSSoC'26"