Information Gathering
WordPress 5.2.3 and earlier allowed unauthenticated users to view non-public posts (drafts, private, password-protected) by adding a specific query parameter that caused the query to return multiple posts, with the first post being public, bypassing access checks. An attacker could read secret content without authentication.
0day.work
Published on 0day.work
A couple of days Wordpress released 5.2.4 with a few security patches. Props to J.D.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The access control check only examined the status of the first post in the result set, so if the first post was public, all subsequent non-public posts were also returned without further checks.
Impact
An unauthenticated attacker could view draft, private, and password-protected posts, potentially exposing sensitive information.
What the attacker needed
WordPress <= 5.2.3; At least one published post and one non-public post; No authentication required
The fix
The vulnerability was fixed in WordPress 5.2.4 by removing the static keyword and adjusting the condition to properly handle the static parameter.
How it was found
- Create a published page and a draft page.
- Visit the site with the static parameter set to 1.
- Observe that the draft is returned but not shown because it is first in the list.
- Add an order parameter to sort ascending so the published page comes first.
- The draft content is then displayed.
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 write-up has not been written yet. The Original tab links to the source.
WordPress lets you create posts that are not yet published, like drafts or private pages. Normally only logged-in authors can see them. This bug let anyone see those hidden posts by adding a special parameter to the web address, because the code only checked the first post in a list and ignored the rest.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.