Unauthenticated Disclosure of Private, Draft, and Password-Protected Post Content via Core Read-Permission Bypass in SCF Reference Fields
The Secure Custom Fields plugin's reference fields resolve stored post IDs without checking read permissions, so an unauthenticated caller can retrieve full details of private, draft, and password-protected posts, including the plaintext post password. This bypasses WordPress core's access controls that would otherwise return 404 or 401.
Originally disclosed on HackerOne
- Fixed in 8 days
- Paid in 8 days
- Disclosed after 9 days
Summary
Secure Custom Fields reference fields resolve stored post IDs through acf_get_posts(), which defaults to post_status => 'any' and never checks read_post. An unauthenticated caller therefore receives the full WP_Post — body, excerpt, author, timestamps, permalink and plaintext post_password — for posts that WordPress core answers with 404 or 401. The write step is only delivery: the leak reproduces with no form submission at all (PoC step 7).
Description
Core boundary. For user 0, core drops non-public posts from WP_Query::$posts (wp-includes/class-wp-query.php:3497-3523) and answers 404; REST answers 401 rest_forbidden; a password-protected post renders the password form instead of the body (wp-includes/post-template.php:882). PoC step 2 records all four responses, plus current_user_can( 'read_post', <private> ) === false.
The sink. acf_get_posts() (includes/api/api-helpers.php:1168) sets post_status => 'any' (:1179) and calls get_posts() (:1211) with no current_user_can( 'read_post' ), no is_post_publicly_viewable() and no post_password_required(). In WordPress 7.1.3 draft, pending and private are not exclude_from_search, so 'any' returns them: PoC step 2 shows WP_Query( post_status='publish' ) = 0 results against acf_get_posts() = 1.
The patch gap. 6.9.3 added $enforce_read_permissions to acf_get_grouped_posts() (api-helpers.php:1286,1307,1443) and wired it to the three AJAX call sites only (commit b520d2c). 6.9.6 added the REST gate, including post_password_required() (includes/rest-api/acf-rest-api-functions.php:501-525, gate at :518). 6.9.7 added expose_reference_target() and strip_post_passwords() for block bindings (includes/Blocks/Bindings.php:145,176). The render path (class-acf-field-relationship.php:532), format_value() (:751; class-acf-field-post_object.php:564; class-acf-field-page_link.php:349,563) and the JSON-LD formatter (page_link.php:720,726) still call the unguarded helper.
The delivery. The vulnerability is the read. A reference written by WP-CLI or an editor leaks identically: PoC step 7 writes the meta directly, with no form, and the anonymous page still renders Private: <title> and returns the private body through get_field(). The signed form grant authorises field keys for saving (includes/forms/form-front.php:868-890) and carries no statement about read permission for referenced posts.
Steps to Reproduce
- Fresh WordPress 7.1.3 + SCF 6.9.7. Create a private post (ID 809), a draft, and a password-protected post (ID 811,
post_password = hunter2). Create a public page that rendersacf_form()with a Relationship field (field_poc_def_rel,post_type: post,page) bound to a public target page. - As user 0,
GET /?page_id=<form page>with no cookies. Keep the hidden inputs_acf_nonce,_acf_form,_acf_form_meta[],_acf_render_id,_acf_post_id,_acf_screen,_acf_validation. POSTthe same URL withacf[field_poc_def_rel][]=809and those grant inputs. Response is302to the return URL, and the target page's meta now holdspoc_def_rel = ["809"].- Re-
GET /?page_id=<form page>. The field renders<span …>Private: POC-DEF PRIVATE TITLE (private)</span>(PoC step 5). The same post's permalink returns404to the same caller (step 2). - As user 0,
get_field( 'poc_def_rel', <target page> )returns aWP_Postwithpost_status = "private", the fullpost_content,post_excerpt,post_authorand timestamps (step 6). Submit811instead and the same call returnspost_password = "hunter2"and the protected body (step 8). POST /wp-login.php?action=postpasswithpost_password=hunter2&redirect_to=/?p=811, keep the returned cookie, thenGET /?p=811→200with the protected body. A wrong password returns no body (step 8).- Submit 50 private IDs in one request (
acf[field_poc_def_rel][]=…× 50). Re-fetch the page and count 50 rendered titles:acf_get_posts()setsposts_per_page => -1(api-helpers.php:1177), so there is no cap (step 9).
AI Disclosure: In accordance with program guidelines, AI tooling was used as an assistant for code analysis and drafting. The vulnerability, the PoC execution, and all manual validations were conducted and verified by me.
Impact
Impact
An unauthenticated attacker can bypass WordPress core's explicit read-permission boundaries to exfiltrate sensitive, non-public data. The impact of this vulnerability is classified as High (7.5) due to the following specific consequences:
- Confidentiality Breach (C:H): The attacker receives the full
WP_Postobject, exposing complete body content, excerpts, author IDs, timestamps, slugs, and permalinks. Crucially, this includes the plaintextpost_passwordfor password-protected posts, allowing the attacker to fully bypass the intended password protection. - WordPress Core Bypass: The vulnerability strictly violates WordPress core's authorization model. The same anonymous caller is explicitly denied access by core (returning
404on the front end and401 rest_forbiddenvia the REST API). Secure Custom Fields (SCF) circumvents these exact core boundaries by returning the data through the unguardedacf_get_posts()function. - Mass Enumeration: The
acf_get_posts()function setsposts_per_page => -1(api-helpers.php:1177), meaning there is no pagination cap. An unauthenticated attacker can submit 50+ sequential IDs in a single request to exfiltrate bulk unpublished content at scale.
Attachments
The complete Proof of Concept (PoC) script, including the Core Baseline control (proving the 404/401 denials) and the No-Form Control (proving the leak occurs without a form submission), along with the full transcript, is attached as *(Attachment on the original report: SCF-6.9.7-Private-Post-Disclosure.zip)*.
Context
Secure Custom Fields (SCF) is a WordPress plugin that adds custom field types, including reference fields such as Relationship, Post Object and Page Link. A reference field stores post IDs and, when rendered, resolves those IDs into WP_Post objects so the template can show titles, links or full post data. The resolution is done by the helper acf_get_posts() in includes/api/api-helpers.php.
WordPress core has a clear read boundary for anonymous users: non-public posts are dropped from query results and the front end answers 404, the REST API answers 401 rest_forbidden, and a password-protected post renders the password form instead of the body. The report shows that SCF's reference resolution does not respect that boundary, so an unauthenticated caller can obtain the full WP_Post for private, draft and password-protected posts, including the plaintext post_password.
The write step in the proof of concept is only a delivery mechanism. The leak reproduces with no form submission at all, as step 7 demonstrates.
Setup
The environment used in the proof of concept:
- Fresh WordPress 7.1.3 with SCF 6.9.7.
- A private post with ID 809, a draft post, and a password-protected post with ID 811 and
post_password = hunter2. - A public page that renders
acf_form()with a Relationship field namedfield_poc_def_rel(post_type: post,page) bound to a public target page. - All requests are made as user 0, that is, with no cookies and no authentication.
Finding it
The researcher compared what core does with what the SCF helper does for the same post and the same anonymous caller.
Core behaviour, as recorded in PoC step 2:
WP_Querydrops non-public posts fromWP_Query::$postsfor user 0 (wp-includes/class-wp-query.php:3497-3523) and the front end answers404.- The REST API answers
401 rest_forbidden. - A password-protected post renders the password form instead of the body (
wp-includes/post-template.php:882). current_user_can( 'read_post', <private> ) === false.
The sink is acf_get_posts() (includes/api/api-helpers.php:1168). It sets post_status => 'any' (:1179) and calls get_posts() (:1211) without any current_user_can( 'read_post' ) check, without is_post_publicly_viewable() and without post_password_required(). In WordPress 7.1.3, draft, pending and private are not exclude_from_search, so 'any' returns them. PoC step 2 shows the contrast directly: WP_Query( post_status='publish' ) returns 0 results, while acf_get_posts() returns 1.
The report also maps the patch history, which explains why the leak survived several releases:
- 6.9.3 added
$enforce_read_permissionstoacf_get_grouped_posts()(api-helpers.php:1286,1307,1443) and wired it to the three AJAX call sites only (commitb520d2c). - 6.9.6 added the REST gate, including
post_password_required()(includes/rest-api/acf-rest-api-functions.php:501-525, gate at:518). - 6.9.7 added
expose_reference_target()andstrip_post_passwords()for block bindings (includes/Blocks/Bindings.php:145,176).
The render path (class-acf-field-relationship.php:532), format_value() (:751; class-acf-field-post_object.php:564; class-acf-field-page_link.php:349,563) and the JSON-LD formatter (page_link.php:720,726) still call the unguarded helper.
Exploitation
Step 1: Prepare the posts and the form page
Create a private post (ID 809), a draft, and a password-protected post (ID 811, post_password = hunter2). Create a public page that renders acf_form() with a Relationship field (field_poc_def_rel, post_type: post,page) bound to a public target page.
Step 2: Record the core baseline
As user 0, request the form page with no cookies:
GET /?page_id=<form page>
Keep the hidden inputs _acf_nonce, _acf_form, _acf_form_meta[], _acf_render_id, _acf_post_id, _acf_screen and _acf_validation. These are the form grant inputs used in the next step. The same step records the core responses for the private post: 404 on the front end, 401 rest_forbidden from REST, the password form for the protected post, and current_user_can( 'read_post', <private> ) === false.
Step 3: Submit the private ID through the form
with the body acf[field_poc_def_rel][]=809 and the grant inputs from step 2. The response is 302 to the return URL, and the target page's meta now holds poc_def_rel = ["809"].
Step 4: Re-fetch the form page
GET /?page_id=<form page>
The field renders:
<span …>Private: POC-DEF PRIVATE TITLE (private)</span>
This is PoC step 5. The same post's permalink returns 404 to the same caller, as recorded in step 2.
Step 5: Read the full post object
As user 0, get_field( 'poc_def_rel', <target page> ) returns a WP_Post with post_status = "private", the full post_content, post_excerpt, post_author and timestamps (step 6). Submitting 811 instead makes the same call return post_password = "hunter2" and the protected body (step 8).
Step 6: Confirm the password bypass
POST /wp-login.php?action=postpass
with post_password=hunter2&redirect_to=/?p=811. Keep the returned cookie, then:
GET /?p=811
This returns 200 with the protected body. A wrong password returns no body (step 8). The plaintext password obtained in step 5 is therefore directly usable to unlock the post.
Step 7: Show the leak without any form submission
The vulnerability is the read. A reference written by WP-CLI or by an editor leaks identically. The PoC writes the meta directly, with no form, and the anonymous page still renders Private: <title> and returns the private body through get_field(). The signed form grant only authorises field keys for saving (includes/forms/form-front.php:868-890) and carries no statement about read permission for referenced posts.
Step 8: Bulk extraction
Submit 50 private IDs in one request:
acf[field_poc_def_rel][]=… × 50
Re-fetch the page and count 50 rendered titles. acf_get_posts() sets posts_per_page => -1 (api-helpers.php:1177), so there is no cap (step 9).
Root cause
The mistake is in acf_get_posts(): it queries with post_status => 'any' and never applies a read-permission check, a public-viewability check or a password check before returning the resolved WP_Post objects. Because draft, pending and private are not exclude_from_search in WordPress 7.1.3, 'any' includes them, and the helper returns them to an anonymous caller.
The existing defences were added incrementally and did not cover every call site. The $enforce_read_permissions flag from 6.9.3 was wired only to the three AJAX call sites. The REST gate from 6.9.6, including post_password_required(), covers only REST. The expose_reference_target() and strip_post_passwords() helpers from 6.9.7 cover only block bindings. The render path, format_value() and the JSON-LD formatter still call the unguarded helper, so the leak remains reachable through those paths. The form grant is not a read authorisation: it signs field keys for saving and says nothing about which referenced posts the caller may read.
Impact
The report classifies the issue as High (7.5). An unauthenticated attacker can bypass WordPress core's read-permission boundaries and exfiltrate non-public data:
- Confidentiality breach (C:H). The attacker receives the full
WP_Postobject, exposing complete body content, excerpts, author IDs, timestamps, slugs and permalinks. This includes the plaintextpost_passwordfor password-protected posts, which lets the attacker bypass the intended password protection entirely. - WordPress core bypass. The same anonymous caller is denied by core (
404on the front end,401 rest_forbiddenvia REST), but SCF returns the data through the unguardedacf_get_posts(). - Mass enumeration. Because
acf_get_posts()setsposts_per_page => -1(api-helpers.php:1177), there is no pagination cap. An unauthenticated attacker can submit 50 or more sequential IDs in a single request and exfiltrate bulk unpublished content at scale.
The report notes that the write step is only delivery and that the leak reproduces without any form submission.
Fix
The relevant changes are:
- 6.9.3:
$enforce_read_permissionsadded toacf_get_grouped_posts()and wired to the three AJAX call sites (commitb520d2c). - 6.9.6: REST gate added, including
post_password_required()(includes/rest-api/acf-rest-api-functions.php:501-525, gate at:518). - 6.9.7:
expose_reference_target()andstrip_post_passwords()added for block bindings (includes/Blocks/Bindings.php:145,176).
The remaining gap is that the render path, format_value() and the JSON-LD formatter still call the unguarded helper.
Variants to test
- Other reference field types. Test Post Object and Page Link fields, not just Relationship. A positive result is the same leak: an anonymous caller receives a
WP_Postfor a private, draft or password-protected post throughget_field()or through the rendered field. - Block bindings and JSON-LD output. Check whether the block bindings path and the JSON-LD formatter still expose referenced posts after the 6.9.7 helpers. A positive result is a rendered binding or JSON-LD document that contains the title or body of a non-public post.
- REST and AJAX paths. Confirm that the 6.9.3 and 6.9.6 gates actually cover every AJAX and REST call site. A positive result is a REST or AJAX response that returns a non-public
WP_Postor itspost_password. - Direct meta writes. Write a reference to a non-public post ID directly through WP-CLI or the editor, then request the public page anonymously. A positive result is the same leak without any form submission, which confirms the read is the vulnerability rather than the write.
- Bulk extraction. Submit many sequential IDs in one request and count the rendered titles. A positive result is a large number of non-public titles returned in a single response, confirming the absence of a pagination cap.
- Password-protected posts. Submit the ID of a password-protected post and check whether
post_passwordis returned in plaintext. A positive result is the plaintext password, which can then be used withPOST /wp-login.php?action=postpassto unlock the post.
What happened, in plain words
A WordPress plugin called Secure Custom Fields (SCF) lets a site owner attach extra pieces of information to a post, such as a list of related posts. One of those field types is called a reference field: instead of storing text, it stores the numeric IDs of other posts, and when the page is displayed the plugin looks those IDs up and shows the titles or links.
The researcher found that this lookup does not ask whether the person viewing the page is allowed to see those posts. WordPress itself is careful here: if you are not logged in and you ask for a private post, WordPress says "not found" (a 404 error page). If you ask the same question through the REST API (explained below), WordPress says "forbidden" (a 401 error). If a post is protected by a password, WordPress shows a password box instead of the text. SCF's lookup skips all of those checks, so a visitor who is not logged in at all can receive the full contents of private posts, drafts and password-protected posts, including the password itself in plain text.
The report also shows that the leak does not depend on a visitor submitting a form. The form in the proof of concept is only a convenient way to plant the reference. If the reference is written some other way, for example by an administrator or by a command-line tool, the anonymous visitor still gets the private content.
A few words before we start, because the rest of the article uses them constantly:
- WordPress is a free system for building websites. A site made with it is a collection of posts (articles, pages, products) stored in a database.
- A plugin is an add-on that gives WordPress extra features. Secure Custom Fields (SCF) is one such plugin.
- A post status says who may see a post.
publishmeans anyone;draftmeans it is still being written;privatemeans only certain logged-in users; a password-protected post is public but locked behind a password. - An API (Application Programming Interface) is a way for one piece of software to ask another for data, like a waiter taking your order to the kitchen and bringing back the plate. WordPress has several: the internal PHP functions used by themes and plugins, and the REST API, which answers over the web with structured data instead of web pages.
- A cookie is a small note a website asks your browser to keep and send back with every later request, so the site can remember who you are. Being unauthenticated (the report calls this "user 0") means having no cookie and no login: a complete stranger.
- Plain text means not scrambled or hashed: the actual characters, readable by anyone.
Context
Secure Custom Fields is a WordPress plugin that adds custom field types. Among them are reference fields: Relationship, Post Object and Page Link. A reference field does not store words; it stores post IDs, which are the numbers WordPress gives every post. When the page is rendered, the plugin turns those numbers back into post objects so the template can show titles, links or the full post data.
That conversion is done by a helper function called acf_get_posts(), which lives in the file includes/api/api-helpers.php. A function is a named block of code that other code can call to do a job; a helper is a small function written to be reused in many places.
WordPress core (the main WordPress code, as opposed to plugins) has a clear read boundary for anonymous visitors:
- non-public posts are dropped from query results, and the front end answers
404(page not found); - the REST API answers
401 rest_forbidden(you are not allowed); - a password-protected post renders the password form instead of the body.
The report shows that SCF's reference resolution does not respect that boundary, so an unauthenticated caller can obtain the full WP_Post (WordPress's internal object representing one post) for private, draft and password-protected posts, including the plaintext post_password (the password stored with the post).
The write step in the proof of concept is only a delivery mechanism: a way to get the reference into place. The leak reproduces with no form submission at all, as step 7 demonstrates.
Setup
The environment used in the proof of concept:
- A fresh WordPress 7.1.3 with SCF 6.9.7. "Fresh" means a clean installation with nothing else customised.
- A private post with ID 809, a draft post, and a password-protected post with ID 811 and
post_password = hunter2. - A public page that renders
acf_form()with a Relationship field namedfield_poc_def_rel(post_type: post,page) bound to a public target page.acf_form()is the plugin's function for putting an editable form on the front end of the site; the field is configured to offer posts and pages as choices, and the form saves its result onto a separate, public page. - All requests are made as user 0, that is, with no cookies and no authentication.
Finding it
The researcher compared what WordPress core does with what the SCF helper does, for the same post and the same anonymous caller. This side-by-side comparison is the heart of the report: if core says no and the plugin says yes, the plugin has broken a rule.
Core behaviour, as recorded in PoC step 2:
WP_Querydrops non-public posts fromWP_Query::$postsfor user 0 (wp-includes/class-wp-query.php:3497-3523) and the front end answers404.WP_Queryis WordPress's internal machinery for fetching posts from the database;$postsis the list of results it produces.- The REST API answers
401 rest_forbidden. - A password-protected post renders the password form instead of the body (
wp-includes/post-template.php:882). current_user_can( 'read_post', <private> ) === false.current_user_can()is WordPress's permission check: it asks "is the current user allowed to do this?". Here it asks whether the current user may read a particular private post, and the answer is no.
The sink is acf_get_posts() (includes/api/api-helpers.php:1168). A sink is the place where data finally leaves the system, the point where the leak actually happens. It sets post_status => 'any' (:1179), meaning "give me posts of every status, not just published ones", and calls get_posts() (:1211) without any current_user_can( 'read_post' ) check, without is_post_publicly_viewable() (a function that asks "can the public see this?") and without post_password_required() (a function that asks "does this post need a password?"). In WordPress 7.1.3, draft, pending and private are not exclude_from_search, so 'any' returns them. PoC step 2 shows the contrast directly: WP_Query( post_status='publish' ) returns 0 results, while acf_get_posts() returns 1.
The report also maps the patch history, which explains why the leak survived several releases. A patch is a code change that fixes a problem; a release is a published version of the software.
- 6.9.3 added
$enforce_read_permissionstoacf_get_grouped_posts()(api-helpers.php:1286,1307,1443) and wired it to the three AJAX call sites only (commitb520d2c). A flag like$enforce_read_permissionsis a switch passed into a function to turn a behaviour on; AJAX is the technique a web page uses to talk to the server in the background without reloading. - 6.9.6 added the REST gate, including
post_password_required()(includes/rest-api/acf-rest-api-functions.php:501-525, gate at:518). A gate is a check placed in front of an action, like a ticket inspector at a door. - 6.9.7 added
expose_reference_target()andstrip_post_passwords()for block bindings (includes/Blocks/Bindings.php:145,176). Block bindings are a WordPress feature that fills blocks (page-building pieces) with data from elsewhere.
The render path (class-acf-field-relationship.php:532), format_value() (:751; class-acf-field-post_object.php:564; class-acf-field-page_link.php:349,563) and the JSON-LD formatter (page_link.php:720,726) still call the unguarded helper. The render path is the code that runs when a page is displayed; format_value() is the function that turns a stored value into something shown on the page; JSON-LD is a structured data format embedded in pages for search engines.
Exploitation
Step 1: Prepare the posts and the form page
Create a private post (ID 809), a draft, and a password-protected post (ID 811, post_password = hunter2). Create a public page that renders acf_form() with a Relationship field (field_poc_def_rel, post_type: post,page) bound to a public target page.
Why: you need something secret to leak (the private, draft and protected posts) and a public place where the plugin will look those secrets up (the form page).
Step 2: Record the core baseline
As user 0, request the form page with no cookies:
GET /?page_id=<form page>
Line by line: GET is the web method used when a browser simply asks for a page. / is the site's address. ?page_id=<form page> is a parameter telling WordPress which page to show; <form page> is a placeholder for the real number. No cookies means the server treats you as a stranger.
Keep the hidden inputs _acf_nonce, _acf_form, _acf_form_meta[], _acf_render_id, _acf_post_id, _acf_screen and _acf_validation. These are the form grant inputs used in the next step. Hidden inputs are fields in a web form that the visitor does not see but the browser sends back with the form. A nonce is a one-time code the server issues so it can tell a genuine form submission from a forged one; a grant here means the set of values that authorise the form to save.
This step also records the core responses for the private post: 404 on the front end, 401 rest_forbidden from REST, the password form for the protected post, and current_user_can( 'read_post', <private> ) === false. Why: this is the control group. It proves that WordPress, on its own, refuses to show these posts to a stranger.
Step 3: Submit the private ID through the form
with the body acf[field_poc_def_rel][]=809 and the grant inputs from step 2. POST is the web method used to send data to the server, as opposed to GET, which asks for a page. The body acf[field_poc_def_rel][]=809 means: in the form data, the field named field_poc_def_rel (inside the group acf) receives the value 809, the ID of the private post. The [] marks it as a list, so several IDs could be sent at once.
The response is 302 to the return URL, and the target page's meta now holds poc_def_rel = ["809"]. A 302 is a redirect: the server says "done, now go to this other address". Meta (short for post meta) is the database table where WordPress stores extra information attached to a post, which is exactly where custom fields live.
Why: this plants the reference. The form is just the delivery van; the interesting part is what happens when the reference is read back.
Step 4: Re-fetch the form page
GET /?page_id=<form page>
The field renders:
<span …>Private: POC-DEF PRIVATE TITLE (private)</span>
Line by line: <span …> is an HTML tag, a container for a piece of text on a page; the … stands for attributes the report does not spell out. The text inside is what the visitor sees: the word Private:, then the title of the private post, then (private), the post's status.
This is PoC step 5. The same post's permalink returns 404 to the same caller, as recorded in step 2. A permalink is the post's own permanent web address. Why this matters: the plugin happily shows the title of a post that WordPress, at its own address, claims does not exist. That contradiction is the bug in one picture.
Step 5: Read the full post object
As user 0, get_field( 'poc_def_rel', <target page> ) returns a WP_Post with post_status = "private", the full post_content, post_excerpt, post_author and timestamps (step 6). get_field() is the plugin's function for reading a custom field's value from code. post_content is the body text, post_excerpt the short summary, post_author the author's ID, and the timestamps record when the post was created and changed.
Submitting 811 instead makes the same call return post_password = "hunter2" and the protected body (step 8). Why: this shows the leak is not limited to titles. The whole post object comes back, and for a protected post that object carries the password in plain text.
Step 6: Confirm the password bypass
POST /wp-login.php?action=postpass
with post_password=hunter2&redirect_to=/?p=811. Line by line: /wp-login.php is WordPress's login script; ?action=postpass tells it the action is checking a post password. The body has two parts joined by &: post_password=hunter2 supplies the password, and redirect_to=/?p=811 says where to go afterwards, namely the protected post with ID 811.
Keep the returned cookie, then:
GET /?p=811
This returns 200 with the protected body. 200 is the standard code for "here is the page you asked for". A wrong password returns no body (step 8). The plaintext password obtained in step 5 is therefore directly usable to unlock the post.
Why: this closes the loop. The password stolen through the plugin is not a curiosity; it is the actual key, and it opens the door through WordPress's normal password form.
Step 7: Show the leak without any form submission
The vulnerability is the read. A reference written by WP-CLI or by an editor leaks identically. WP-CLI is a tool for managing WordPress from a command line instead of a browser. The PoC writes the meta directly, with no form, and the anonymous page still renders Private: <title> and returns the private body through get_field(). The signed form grant only authorises field keys for saving (includes/forms/form-front.php:868-890) and carries no statement about read permission for referenced posts.
Why this step exists: someone might argue that the form submission is the bug, and that blocking forms would fix it. This step removes the form entirely and the leak remains, so the fault is in the reading, not the writing. The grant is like a signed permission slip to put a document in a drawer; it says nothing about who may take the document out again.
Step 8: Bulk extraction
Submit 50 private IDs in one request:
acf[field_poc_def_rel][]=… × 50
Line by line: this is the same field name as in step 3, repeated fifty times with different IDs in place of the …, all in a single request. The × 50 is shorthand for "repeat this fifty times".
Re-fetch the page and count 50 rendered titles. acf_get_posts() sets posts_per_page => -1 (api-helpers.php:1177), so there is no cap (step 9). posts_per_page is the setting that limits how many posts come back at once; -1 is WordPress's convention for "no limit". Why: this turns a single leak into a harvesting tool. One request can pull back dozens of unpublished titles, and nothing in the plugin stops the number growing.
Root cause
The mistake is in acf_get_posts(): it queries with post_status => 'any' and never applies a read-permission check, a public-viewability check or a password check before returning the resolved WP_Post objects. Because draft, pending and private are not exclude_from_search in WordPress 7.1.3, 'any' includes them, and the helper returns them to an anonymous caller.
The existing defences were added incrementally and did not cover every call site. A call site is a place in the code where a function is called. The $enforce_read_permissions flag from 6.9.3 was wired only to the three AJAX call sites. The REST gate from 6.9.6, including post_password_required(), covers only REST. The expose_reference_target() and strip_post_passwords() helpers from 6.9.7 cover only block bindings. The render path, format_value() and the JSON-LD formatter still call the unguarded helper, so the leak remains reachable through those paths. The form grant is not a read authorisation: it signs field keys for saving and says nothing about which referenced posts the caller may read.
A useful comparison: the developers kept locking individual windows while the front door stayed open. Each patch guarded one route into the same helper, but the helper itself never learned to check permission.
Impact
The report classifies the issue as High (7.5). An unauthenticated attacker can bypass WordPress core's read-permission boundaries and exfiltrate non-public data. Exfiltrate means to copy data out of a system without permission.
- Confidentiality breach (C:H). The attacker receives the full
WP_Postobject, exposing complete body content, excerpts, author IDs, timestamps, slugs and permalinks. A slug is the readable part of a web address, such as the post's name in the URL. This includes the plaintextpost_passwordfor password-protected posts, which lets the attacker bypass the intended password protection entirely. In CVSS, C:H means confidentiality impact is High: secrets are exposed. - WordPress core bypass. The same anonymous caller is denied by core (
404on the front end,401 rest_forbiddenvia REST), but SCF returns the data through the unguardedacf_get_posts(). - Mass enumeration. Because
acf_get_posts()setsposts_per_page => -1(api-helpers.php:1177), there is no pagination cap. Enumeration means walking through a list of identifiers one by one, or in bulk, to see what exists. An unauthenticated attacker can submit 50 or more sequential IDs in a single request and exfiltrate bulk unpublished content at scale.
The report notes that the write step is only delivery and that the leak reproduces without any form submission.
Fix
The relevant changes are:
- 6.9.3:
$enforce_read_permissionsadded toacf_get_grouped_posts()and wired to the three AJAX call sites (commitb520d2c). - 6.9.6: REST gate added, including
post_password_required()(includes/rest-api/acf-rest-api-functions.php:501-525, gate at:518). - 6.9.7:
expose_reference_target()andstrip_post_passwords()added for block bindings (includes/Blocks/Bindings.php:145,176).
The remaining gap is that the render path, format_value() and the JSON-LD formatter still call the unguarded helper. In plain terms: fix the front door, not each window.
Variants to test
- Other reference field types. Test Post Object and Page Link fields, not just Relationship. A positive result is the same leak: an anonymous caller receives a
WP_Postfor a private, draft or password-protected post throughget_field()or through the rendered field. - Block bindings and JSON-LD output. Check whether the block bindings path and the JSON-LD formatter still expose referenced posts after the 6.9.7 helpers. A positive result is a rendered binding or JSON-LD document that contains the title or body of a non-public post.
- REST and AJAX paths. Confirm that the 6.9.3 and 6.9.6 gates actually cover every AJAX and REST call site. A positive result is a REST or AJAX response that returns a non-public
WP_Postor itspost_password. - Direct meta writes. Write a reference to a non-public post ID directly through WP-CLI or the editor, then request the public page anonymously. A positive result is the same leak without any form submission, which confirms the read is the vulnerability rather than the write.
- Bulk extraction. Submit many sequential IDs in one request and count the rendered titles. A positive result is a large number of non-public titles returned in a single response, confirming the absence of a pagination cap.
- Password-protected posts. Submit the ID of a password-protected post and check whether
post_passwordis returned in plaintext. A positive result is the plaintext password, which can then be used withPOST /wp-login.php?action=postpassto unlock the post.
Glossary
- AJAX: a technique where a web page talks to the server in the background, without reloading the whole page.
- API (Application Programming Interface): a defined way for one piece of software to ask another for data or actions, like a waiter carrying orders to a kitchen.
- Block bindings: a WordPress feature that fills page-building blocks with data from elsewhere.
- Call site: a place in the code where a particular function is called.
- Cookie: a small note a website asks your browser to store and send back with later requests, used to remember who you are.
- CVSS score: a standard 0 to 10 scale for rating the severity of a security flaw.
- Draft: a post status meaning the post is still being written and is not published.
- Enumeration: systematically walking through identifiers to discover what exists.
- Exfiltrate: to copy data out of a system without permission.
- Flag: a switch passed into a function to turn a behaviour on or off.
- Gate: a check placed in front of an action, like a ticket inspector at a door.
- GET: the web method used when a browser simply asks for a page.
- Grant: the set of values that authorise a form to save.
- Helper: a small function written to be reused in many places.
- Hidden input: a form field the visitor does not see but the browser sends back with the form.
- JSON-LD: a structured data format embedded in web pages for search engines.
- Meta (post meta): the database table where WordPress stores extra information attached to a post, including custom fields.
- Nonce: a one-time code issued by the server so it can tell a genuine form submission from a forged one.
- Patch: a code change that fixes a problem.
- Permalink: a post's own permanent web address.
- Plain text: not scrambled or hashed; the actual readable characters.
- Plugin: an add-on that gives WordPress extra features.
- POST: the web method used to send data to the server.
- Private: a post status meaning only certain logged-in users may see the post.
- Publish: a post status meaning anyone may see the post.
- Release: a published version of a piece of software.
- Render path: the code that runs when a page is displayed.
- REST API: a web interface that answers with structured data instead of web pages.
- SCF (Secure Custom Fields): a WordPress plugin that adds custom field types, including reference fields.
- Sink: the place where data finally leaves the system; the point where a leak actually happens.
- Slug: the readable part of a web address, such as a post's name in the URL.
- Uncaught / unauthenticated (user 0): having no login and no cookie; a complete stranger to the site.
- WP-CLI: a tool for managing WordPress from a command line instead of a browser.
- WP_Query: WordPress's internal machinery for fetching posts from the database.
- WP_Post: WordPress's internal object representing a single post.
- 302: an HTTP response meaning "done, now go to this other address" (a redirect).
- 401: an HTTP response meaning "you are not allowed".
- 404: an HTTP response meaning "page not found".
- 200: an HTTP response meaning "here is the page you asked for".