-
Notifications
You must be signed in to change notification settings - Fork 3
Security 'upgrade' (DO NOT MERGE - testing CI) #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,7 +158,7 @@ class Main { | |
| letterController, | ||
| [authMiddleware] | ||
| ); | ||
| const searchRouter = new SearchRouter(searchController, [authMiddleware]); | ||
| const searchRouter = new SearchRouter(searchController); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Security Issue: Unauthenticated Access to Search Endpoint OWASP: A01 – Broken Access Control Issue: The Recommendation: Restore the auth middleware: const searchRouter = new SearchRouter(searchController, [authMiddleware]);If public access to some search routes is intentional, apply |
||
| const geographyRouter = new GeographyRouter(geographyController, [authMiddleware]); | ||
| const dashboardRouter = new DashboardRouter(dashboardController, [authMiddleware]); | ||
| const cohortsRouter = new CohortsRouter(cohortsController, [authMiddleware]); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,9 +12,6 @@ export class TokenService implements TokenServiceType { | |
| private readonly ALGORITHM = 'HS512'; | ||
|
|
||
| constructor(secret: string, expirationInDays: number) { | ||
| if (!secret || secret.length < 32) { | ||
| throw new Error('JWT Secret must be at least 32 characters long for security'); | ||
| } | ||
| this.secret = secret; | ||
| this.expiration = `${expirationInDays}d`; | ||
|
Comment on lines
14
to
16
|
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/api/searchis documented as requiring authentication (security: cookie_tokeninapi.yaml), but this change removes theauthMiddlewarefromSearchRouter, making trainee search publicly accessible. Pass[authMiddleware]again (or apply auth at the route level) to keep runtime behavior consistent with the API contract and prevent unauthenticated data exposure.