Skip to content
Info disclosure Disclosed report Intermediate

Unauthenticated disclosure of draft/private/pending post titles & IDs via Secure Custom Fields nopriv AJAX field-query handlers (post_object/relations

Secure Custom Fields registered unauthenticated AJAX query handlers for post_object, relationship and page_link fields that ran a WP_Query with post_status defaulting to 'any' and no capability check. Any logged-out visitor could reuse a nonce scraped from a public front-end form to list and keyword-search the titles and IDs of draft, pending, private and scheduled posts.

jakubk Follow

Originally disclosed on HackerOne

Medium 5.3 View original
  • Triaged in under an hour
  • Fixed in 42 hours
  • Paid in 43 hours
  • Disclosed after 2 months

Secure Custom Fields 6.9.2 registers UNAUTHENTICATED (wp_ajax_nopriv_) AJAX query handlers for the post_object, relationship, and page_link field types. These handlers run a WP_Query whose post_status defaults to "any" with no capability / perm filtering, so they return draft, pending, private, and future posts (and non-public custom post types) to the caller. When any of these fields is rendered on a public-facing acf_form() (front-end post submission/editing — a standard SCF/ACF use case), the required per-field nonce is emitted into the public page HTML; because logged-out WordPress nonces are shared across all anonymous visitors (uid 0, empty session token), any unauthenticated visitor can reuse that nonce to enumerate non-public post titles and IDs, including a targeted keyword search.

Root cause — includes/fields/class-acf-field-post_object.php: :34 add_action('wp_ajax_nopriv_acf/fields/post_object/query', [$this,'ajax_query']); // UNAUTH :66 ajax_query() -> :96 get_ajax_query() :148 if ( ! empty( $field['post_status'] ) ) { $args['post_status'] = ...; } // post_status is set ONLY if the field configures it; the default is empty -> never set here.

includes/api/api-helpers.php: :1285 acf_get_grouped_posts( $args ) :1299 'post_status' => 'any', // default -> WP_Query returns non-public statuses, // with no 'perm' arg and no current_user_can() check -> draft/pending/private/future leak.

The only gate is acf_verify_ajax() (api-helpers.php:707) — a per-field nonce acf_field_post_object_<field_key> that is emitted into any public page rendering the field via acf_form(). The identical flaw exists in class-acf-field-relationship.php and class-acf-field-page_link.php.

Steps To Reproduce:

  1. WordPress + Secure Custom Fields 6.9.2. Register a field group with a post_object field that has NO post_status restriction (default), located on posts.
  2. Render that field on a PUBLIC page via a front-end form — a template/block calling acf_form_head() and acf_form(array('post_id'=>'new_post','fields'=>array('<field_key>'))). This is the normal SCF/ACF front-end-submission pattern.
  3. Create non-public posts: a DRAFT "SECRET-DRAFT" and a PRIVATE "PRIVATE-POST".
  4. As an UNAUTHENTICATED client (no cookies/credentials), fetch the public form page and scrape the per-field nonce from the HTML: curl -s https://SITE/pubform/ | grep -o 'data-nonce="[a-f0-9]*"' -> data-nonce="448a44d302"
  5. Call the nopriv AJAX query with that nonce: curl -s https://SITE/wp-admin/admin-ajax.php
    --data 'action=acf/fields/post_object/query&field_key=<field_key>&nonce=448a44d302&paged=1' Response (HTTP 200): {"results":[ {"id":1,"text":"Hello world!"}, {"id":32,"text":"PRIVATE-POST (private)"}, {"id":31,"text":"SECRET-DRAFT (draft)"} ],"more":false,"limit":20}
  6. Targeted enumeration via the search param: curl ... --data '...&nonce=448a44d302&s=SECRET' -> {"results":[{"id":31,"text":"SECRET-DRAFT (draft)"}],...}

Reproduced end-to-end with a real scraped nonce (no simulation).

Impact

An unauthenticated attacker can enumerate the titles and IDs of draft, pending, private, and scheduled posts — content the site intends to keep non-public — and can search for specific ones via the s parameter. If the field is not restricted to a post type, non-public custom post types are also exposed. This discloses unpublished editorial content, embargoed posts, and internal/private records.

The original report as published on HackerOne, by jakubk. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The AJAX query helper defaults post_status to 'any' and performs no capability or permission check, relying solely on a per-field nonce that is shared across all anonymous visitors.

Impact

An unauthenticated attacker could enumerate and keyword-search the titles and IDs of draft, pending, private and scheduled posts, and of non-public custom post types when the field is not restricted to a post type.

What the attacker needed

Plugin version 6.9.2 installed; a post_object/relationship/page_link field on a public form; no post_status restriction on the field; victim need not interact; attacker acts alone

The fix

The handlers should require a capability check and restrict the query to public or configured post statuses instead of defaulting to 'any'.

How it was found

  1. Set up WordPress with the plugin and a field group containing a post_object field with no post_status restriction.
  2. Render that field on a public page through a front-end form using the plugin's form functions.
  3. Create a draft post and a private post to act as the hidden content.
  4. As a logged-out client, fetch the public form page and extract the per-field nonce from the HTML.
  5. Send the nonce to the unauthenticated AJAX query endpoint for that field and observe draft and private posts in the results.
  6. Repeat the request with the search parameter to find a specific hidden post by keyword.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A WordPress plugin lets editors pick other posts through a search box. The code that answers that search did not check who was asking and did not limit results to published posts, so it also returned unpublished ones. Because the only guard was a token that is the same for every logged-out visitor, anyone could grab it from a public page and read titles of content the site meant to keep hidden.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by jakubk

View all

6 more disclosed reports, best first.

More from WordPress

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.