fix: remove admin flag from User $fillable to prevent privilege escalation#722
Closed
cchopin wants to merge 1 commit into
Closed
fix: remove admin flag from User $fillable to prevent privilege escalation#722cchopin wants to merge 1 commit into
cchopin wants to merge 1 commit into
Conversation
Contributor
|
Please stop posting spam reports for non-issues. @Crypta-Eve this should be closed |
Member
|
Given that the only requests that can update users anyway are restricted to people who are already admin, this is irrelevant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Fix: Privilege Escalation via Mass Assignment
Vulnerability
The
Usermodel included'admin'in its$fillablearray:Laravel's mass assignment protection works by only allowing attributes listed in
$fillableto be set viafill(),create(), orupdate()calls. Includingadminin this list means that any controller endpoint passing request data directly to these methods could allow an authenticated user to elevate their own privileges by includingadmin=1in the request body.Impact
If any endpoint in the application (including third-party plugins) uses a pattern like:
An attacker could include
admin=truein the POST body and become an administrator, gaining full access to all SeAT data, user management, and configuration.This is classified as CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes.
Fix
Removed
'admin'from$fillable. Theadminflag should only be set through explicit, privileged code paths usingforceFill()or direct attribute assignment in contexts where the caller's authorization has already been verified.References