Focus role-capabilities-check on privilege escalation#183
Closed
Focus role-capabilities-check on privilege escalation#183
Conversation
Simplify the role capabilities checker to only detect added capabilities on default WordPress roles (privilege escalation). Remove detection of removed capabilities and extra/non-default roles. Add subscriber escalation step to simulate-hack.sh for testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
Closing this for now. The PHP changes look reasonable, but the JS files (role-capabilities-check.js and check-if-hacked.js) were not updated to match the new schema, which silently breaks the ability. interpretResult filters on "modified" while PHP now returns "escalated", and several removed fields (extra_roles, role.removed) are still referenced. Created #188 to track the full scope of changes needed. The extra_roles removal also warrants a broader discussion about detection coverage. Thanks for the contribution, this is a valuable direction, it just needs more attention on the JS side before merging. |
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.
Summary
manage_options) tosimulate-hack.shChanges
includes/abilities/security/role-capabilities-check.phpextra_roles(non-default roles) detectionwp_agentic_admin_execute_role_capabilities_check()to only flag roles with added capabilities beyond WordPress defaultsmodifiedtoescalatedfor flagged roleswp_agentic_admin_calculate_role_risk()— removed$removedparameter and the early-return for removal-only casesextra_rolesfield, updated descriptions to reflect escalation focussimulate-hack.shmanage_optionscapability viawp cap addTest plan
bash simulate-hack.shto plant the subscriber escalationdefault(not flagged)composer lintto confirm PHP passes WPCS🤖 Generated with Claude Code