Skip to content

role-capabilities-check: JS files out of sync with PHP schema #188

Description

@pluginslab

Problem

PR #183 changed the PHP backend for role-capabilities-check but did not update the corresponding JS files, which would silently break the ability:

Status mismatch

  • PHP now returns status: 'escalated' instead of 'modified'
  • role-capabilities-check.js (line 131-133) and check-if-hacked.js (line 295-296) both filter on r.status === 'modified', meaning escalated roles will never appear in the LLM interpretation or the workflow summary

Removed fields still referenced in JS

  • role.removed is referenced in summarize (lines 70-72) and interpretResult (lines 142-148) but no longer exists in the PHP response
  • result.extra_roles is referenced in both JS files but was removed from the PHP response

Security trade-off to discuss

Removing extra_roles detection means attacker-created roles (e.g., a custom "Support" role with manage_options) will no longer be flagged. This is one of the most common persistent backdoor vectors. Should this be split into a separate ability rather than removed entirely?

False positive concern

Any plugin adding custom capabilities to built-in roles (WooCommerce adding manage_woocommerce to administrator) will trigger an escalation warning. The new 'escalated' label is more alarming than the old 'modified' for what is typically benign plugin behavior.

Required changes

  1. Update role-capabilities-check.js: change 'modified' filter to 'escalated', remove all removed and extra_roles references, update docblock
  2. Update check-if-hacked.js: same status filter fix, remove stale extra_roles and removed references
  3. Update PHP file-level docblock (line 7) to remove mention of "extra roles"
  4. Discuss whether extra_roles detection should be a separate ability

Context

Discovered during review of PR #183. PR closed pending these fixes.

Activity

  1. pluginslab commented on May 12, 2026

    @pluginslab
    OwnerAuthor

    Closing as not-applicable: PR #183 was closed without merging, so the PHP changes that would have caused the JS desync never landed. Verified on dev:

    • PHP role-capabilities-check.php still returns status: 'modified', removed field, and extra_roles array (lines 128, 130, 188 in dev)
    • JS role-capabilities-check.js filters on status === 'modified' and reads role.removed / result.extra_roles (lines 78, 96, 132)
    • JS check-if-hacked.js matches the same shape

    Both sides are aligned on the current model. The hypothetical desync described in this issue does not exist.

    The two product questions raised in this issue remain valid but are out of v0.11 scope:

    1. Should extra_roles detection (attacker-created roles like 'Support' with manage_options) be split into a separate ability?
    2. Is the 'escalated' label too alarming for benign plugin-added capabilities (e.g. WooCommerce adding manage_woocommerce to administrator)?

    If we want to revisit either, please open a fresh issue with the specific product decision to make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions