-
Notifications
You must be signed in to change notification settings - Fork 0
π‘οΈ Sentinel: [CRITICAL] Fix privilege escalation vulnerability in updateRole #232
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
base: master
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -124,6 +124,12 @@ export function updateRole( | |
| throw new DatabaseError('NOT_FOUND', SCHOOL_ERRORS.ROLE_NOT_FOUND) | ||
| } | ||
|
|
||
| const role = roleResult.value | ||
|
|
||
| if (role.isSystemRole) { | ||
| throw new DatabaseError('VALIDATION_ERROR', 'Cannot modify system roles') | ||
|
Comment on lines
+129
to
+130
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.
This unconditional guard blocks all updates to Useful? React with πΒ / π. |
||
| } | ||
|
|
||
| const [updated] = await db | ||
| .update(roles) | ||
| .set({ | ||
|
|
||
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.
Verify the entry date.
The date
2025-03-18appears inconsistent with the PR creation date (April 2026). If this is a historical record of when the vulnerability was discovered, consider clarifying. Otherwise, update to the current date.The documentation content itself accurately describes the vulnerability, learning, and prevention measures.
π€ Prompt for AI Agents