CRITICAL: Authentication is completely disabled — authMiddleware returns mock user for all requests #4
Labels
No labels
blocked:needs-human
blocked:verify-failed
bug
feature-request
quickfix
security/high
security/medium
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/subvault#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Critical
Location
backend/src/auth.tslines 20–28Description
The
authMiddlewarefunction completely ignores JWT tokens and returns a hardcoded anonymous user for EVERY request:This means any protected endpoint (
/api/subscriptions,/api/auth/me,/api/pricing,/api/news,/api/dashboard/stats) is accessible to anyone without any authentication. All users share a single anonymous user context, so subscription data is not isolated.Impact
anonymous-usercontextSuggested Fix
Remove the hardcoded mock user. Re-enable real JWT verification:
Note
If the
NO_AUTHmode is intentionally for development, it should be gated behind an environment variable check, not the default behavior.Fixed. Closing.