Abstract. Content platforms routinely let an administrator hand a trusted non-administrator control over one narrow slice of configuration. That delegation is only as strong as its weakest privilege-mutating code path; every path that changes a privilege has to enforce the same authorization boundary, or the boundary is not really there. PublishPress Capabilities (
capability-manager-enhanced) gets this right on its main "save" path, which confines a delegated manager to capabilities they already hold, and wrong on a sibling "add capability" path, which skips the check. The gap lets a delegated manager grant their own role any capability, up to administrator-equivalent access. We cover the root cause and the fix at the secure-coding level. Under coordinated disclosure the full proof-of-concept stays withheld until a fix ships; this write-up is defensive and educational.
Keywords: WordPress security, privilege escalation, broken access control, missing authorization, CWE-862, CWE-269, delegated administration, secure coding.
1. Introduction
PublishPress Capabilities is a widely deployed WordPress role and capability editor with more than 100,000 active installations. Delegation is one of its main draws: an administrator can grant the manage_capabilities capability to a non-administrator role such as Editor, so trusted staff can adjust capabilities without holding the keys to the whole site.
The feature is safe only while the delegated manager stays confined to a strictly smaller set of powers than a full administrator. This is a clean instance of broken access control / missing authorization (CWE-862, CWE-269), the bug class that has sat at the top of the OWASP risk rankings for years. When one privilege-mutating code path enforces a boundary and a parallel path does not, the weaker path defines the real security of the system. The asymmetry here is worth studying on its own merits, well beyond this single plugin.
2. Affected component
| Plugin | PublishPress Capabilities (free) — slug capability-manager-enhanced |
| Tested version | 2.52.0 (current/latest at time of testing) |
| Active installations | 100,000+ |
| Vulnerability type | Privilege Escalation (Broken Access Control / Missing Authorization) → full site takeover / RCE |
| CWE | CWE-862 Missing Authorization / CWE-269 Improper Privilege Management |
| Required privilege | Authenticated non-administrator holding the delegated manage_capabilities capability |
| User interaction | None |
| CVSS 3.1 | 8.8 (High) — AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Status | Fresh (0-day), reproduced in an isolated lab on the current version; unpatched at time of writing |
3. Technical analysis
The plugin is designed so that a delegated manager is deliberately short of a full administrator. The normal "Save Changes" path, CapsmanHandler::saveRoleCapabilities(), enforces a per-capability allow-list, so a non-admin can only toggle capabilities they already possess.
That intended restriction is visible in the "Save Role" path itself — includes/handler.php, saveRoleCapabilities() (~lines 267–276):
if ( ! $is_administrator = current_user_can('administrator') ) {
unset($add_caps['manage_capabilities']);
unset($del_caps['manage_capabilities']);
}
...
foreach ( $add_caps as $cap => $grant ) {
if ( $is_administrator || current_user_can($cap) ) // <-- allow-list: must already hold the cap
$role->add_cap( $cap, $grant );
}A non-administrator may grant only a capability they already hold. That constraint is exactly what makes manage_capabilities safe to delegate.
The "Add a New Capability" (AddCap) path drops that allow-list — includes/handler.php, processAdminGeneral() (~lines 91–127):
} elseif (!empty($_POST['AddCap']) && !empty($_POST['current']) && !empty($_POST['capability-name'])) {
...
if (empty($_POST['current']) || !pp_capabilities_is_editable_role(sanitize_key($_POST['current']))) {
ak_admin_error(__('The selected role is not editable.', ...));
return;
}
$role = get_role(sanitize_key($_POST['current']));
$role->name = sanitize_key($_POST['current']);
$newname = $this->createNewName(sanitize_text_field(wp_unslash($_POST['capability-name'])), ['allow_dashes' => true]);
if (empty($newname['error'])) {
$role->add_cap($newname['name']); // <-- NO current_user_can($cap) check
...
}
}Both paths end at $role->add_cap(...), yet only one of them ever asks whether the actor is allowed to grant this capability. The AddCap branch validates that the capability name is well-formed and not already present, then grants it — it never checks whether the actor holds the capability being added.
Three further design facts turn that omission into something an attacker can actually use:
- The name validator does nothing to protect privileged core capabilities for a non-admin.
createNewName()rejects a name only if it is already a role or already a key of the current capability list. For a non-administrator, that list is built from the attacker's ownallcaps, so capabilities the actor lacks (edit_files,edit_users,manage_options,promote_users, …) are simply missing from the list and sail through validation as if they were brand-new names:
} else { // non-administrator branch
$user = new WP_User($user_ID);
$keys = array_keys($user->allcaps); // only the attacker's own caps
$this->capabilities = ($keys) ? array_combine($keys, $names) : array();
...
}- The own-role exclusion guard reads a different request field than the authorization gate. The plugin normally drops the current user's own role from the editable list, but only when
is_pp_capabilities_admin_page()returns true. That helper reads$_GET['page'](includes/functions.php, ~line 786), while the handler is routed and authorized from$_REQUEST['page']. Taking authorization state from one source and a safety guard from another is a textbook parameter-source inconsistency.
if (isset($_GET['page']) && in_array($_GET['page'], $pp_capabilities_pages)) {
$is_pp_capabilities_page = true;
}- Reaching the sink costs only
manage_capabilities. The handler (processRoleUpdate(),includes/manager.php, ~line 1194) fires oninitfor admin requests and checks a nonce plus:
check_admin_referer('capsman-general-manager');
if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('manage_capabilities')) {
wp_die('You do not have permission to manage capabilities.');
}So manage_capabilities alone is enough to reach the vulnerable sink — the very capability the plugin exists to delegate to non-admins.
4. How the flaw is reached (conceptual)
Picture one boundary enforced on one road and absent on a parallel road to the same destination.
The "Save Changes" road and the "Add Capability" road both end at the same WordPress primitive that attaches a capability to a role. The first road checks, for every capability, whether the actor is an administrator or already holds it. The second road runs a structural check on the capability name and then attaches it.
The non-administrator's name-validation list comes from their own current capabilities, so any capability they do not already hold reads to that validator as an unfamiliar new label rather than a privileged core capability, and is not rejected. A delegated manager can therefore attach to a role a capability far more powerful than anything they were granted — among them capabilities that open the plugin/theme file editor (and with it arbitrary server-side code) or that create and promote users.
A second, independent weakness lets the actor aim the operation at their own role instead of only at other roles. The guard that would normally exclude the actor's own role consults a request field that differs from the one the request was authorized on. When the two disagree, authorization still passes while the own-role protection quietly switches off.
The essential risk, with no operational recipe attached: a user trusted with a narrow delegated power can take the weaker path, reach past that power, and assemble administrator-equivalent authority. No victim interaction is needed; the actor stays entirely inside their own authenticated session. We deliberately leave out the exact request sequence, parameter values, and nonce handling. Those stay withheld pending a fix.
5. Impact assessment
A non-administrator holding only the delegated manage_capabilities capability can grant their own role any WordPress capability and reach administrator-equivalent access. On a default single-site install where DISALLOW_FILE_EDIT is not set, capabilities like edit_files / edit_plugins expose the in-dashboard theme and plugin file editor, which allows writing arbitrary PHP — in other words remote code execution and full site takeover. Capabilities like edit_users / promote_users / create_users allow creating or promoting an administrator account.
That breaks the plugin's own security boundary head-on. The saveRoleCapabilities() allow-list exists specifically to make manage_capabilities safe to delegate, and the AddCap path voids the guarantee.
The CVSS 3.1 vector AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (8.8, High) captures a network-reachable, low-complexity action that needs low privilege — an existing delegated account — and no user interaction, with high impact to confidentiality, integrity, and availability once administrator-equivalent control is in hand. The single precondition, that an administrator has delegated manage_capabilities, is the plugin's advertised use case rather than an exotic setup.
6. Remediation
Make the AddCap path enforce the same authorization the "Save Role" path already applies, and align the own-role guard with the routing source.
// In the AddCap branch of CapsmanHandler::processAdminGeneral():
// Apply the same authorization used by saveRoleCapabilities().
$cap = $newname['name'];
$is_administrator = current_user_can('administrator') || ( is_multisite() && is_super_admin() );
if ( ! $is_administrator && ! current_user_can( $cap ) ) {
// Granting a brand-new, never-before-seen capability is harmless;
// granting an existing privileged capability the actor lacks is not.
ak_admin_error( __( 'You are not allowed to add that capability.', 'capability-manager-enhanced' ) );
return;
}
$role->add_cap( $cap );// In includes/functions.php, read the SAME request source used for routing/authorization,
// so the own-role exclusion cannot be bypassed by moving `page` into the POST body:
if ( isset($_REQUEST['page']) && in_array( sanitize_key($_REQUEST['page']), $pp_capabilities_pages, true ) ) {
$is_pp_capabilities_page = true;
}Until a fixed release is out, site operators should:
- Treat
manage_capabilitiesas administrator-equivalent and revoke it from any non-administrator role you would not trust with the entire site. - Set
define('DISALLOW_FILE_EDIT', true);inwp-config.php. This does not fix the escalation, but it removes the dashboard file editor and so closes the most direct route from the escalation to arbitrary PHP execution. - Update the plugin the moment a fixed version ships.
7. Detection and hardening for site owners
The abuse happens inside an authenticated admin session, so detection turns on unexpected capability and role changes rather than failed logins:
- Audit role capabilities. Export your roles' capabilities on a schedule and diff them against a known-good baseline. A non-administrator role that suddenly holds
edit_files,edit_plugins,manage_options,edit_users,promote_users,create_users, oractivate_pluginsis a strong sign of abuse. - Watch for new or newly promoted administrators. Alert on any account gaining an administrator role, or on user creation outside your normal workflow.
- Monitor file integrity on
wp-content. Unexpected changes to theme or plugin PHP files, especially right after a role change, warrant immediate investigation. - Apply least privilege. Delegate the narrowest capabilities staff genuinely need, and favour purpose-built, scoped capabilities over broad ones.
- Disable the dashboard file editor (
DISALLOW_FILE_EDIT) as standard hardening. - Virtual patching / WAF. A web application firewall can be set to flag or block anomalous capability-management requests as a stop-gap. It is a mitigation, not a replacement for the vendor fix.
- Keep everything updated and apply the fixed plugin release promptly once it ships.
8. The broader lesson
The general principle: enforce authorization at every sink that mutates a protected resource, not only at the busiest one. When two code paths reach the same privileged operation, they have to share the same authorization check — ideally by funnelling both through a single enforcement function instead of re-implementing the check, correctly or not, in each branch.
Two supporting lessons back it up. First, never derive an allow-list from the actor's own state in a way that silently treats "powers you lack" as "harmless unknowns." Second, read authorization inputs and security-guard inputs from the same request source. Mixing $_GET, $_POST, and $_REQUEST for decisions that must agree is a recurring source of access-control bypasses; pick one canonical, sanitized source and use it everywhere.
9. Responsible disclosure
This research followed coordinated (responsible) disclosure. The vendor was notified privately, and full technical reproduction detail is deliberately held back from this public article until a fix is available. We plan to publish complete details only after a fixed release, or after the agreed disclosure window, with timing coordinated with the maintainer.
All testing ran exclusively on an isolated, locally-bound WordPress install under our control. No third-party or production systems were accessed, and no live site was exploited. Noroxi LLC conducts authorized security research only.
References
- CWE-862: Missing Authorization — https://cwe.mitre.org/data/definitions/862.html
- CWE-269: Improper Privilege Management — https://cwe.mitre.org/data/definitions/269.html
- OWASP Top 10 — A01:2021 Broken Access Control — https://owasp.org/Top10/A01_2021-Broken_Access_Control/
- WordPress Developer Handbook — Roles and Capabilities — https://developer.wordpress.org/plugins/users/roles-and-capabilities/
- WordPress Developer Handbook — Checking User Capabilities — https://developer.wordpress.org/plugins/security/checking-user-capabilities/
- WordPress Developer Handbook — Nonces — https://developer.wordpress.org/apis/security/nonces/
- FIRST CVSS v3.1 Calculator — https://www.first.org/cvss/calculator/3.1
Published for defensive and educational purposes. Noroxi LLC conducts authorized security research only; operational exploit detail is withheld until a fix is available.
Exploited this week · every Monday
New KEV entries, fresh PoCs, WordPress triage and what to do this week. No account needed.