WordPress Core Unauthenticated Blind SSRF
WordPress core's pingback feature validates a user-supplied URL and then re-resolves the hostname when making the HTTP request, allowing an attacker to change the DNS record between validation and use. This enables unauthenticated blind SSRF, letting the server send requests to internal services or cloud metadata endpoints.
sonarsource.com
Published on sonarsource.com
WordPress is the world’s most popular content management system, used byover 40% of all websites. This wide adoption makes it a top target for threat actors and security researchers that get paid for reporting security issues through their public bug bounty program.
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 URL was validated (including DNS resolution) but the hostname was resolved again later when the HTTP request was made, so the attacker could change the DNS answer between check and use (a time-of-check-time-of-use flaw).
Impact
The impact is low for most WordPress users as-is, but it could ease exploitation of other vulnerabilities in the internal network, such as reaching cloud metadata endpoints or internal services.
What the attacker needed
Pingback enabled (default); attacker controls a domain's DNS; ability to send XML-RPC requests
The fix
The fix should persist the validated IP addresses and use them for the actual request instead of re-resolving; WordPress introduced an optional by-reference argument to wp_http_validate_url() to carry the validated IPs, but no public patch was available at the time of writing.
How it was found
- Send an XML-RPC request invoking pingback.ping with pagelinkedfrom set to an attacker-controlled domain and pagelinkedto pointing to a local article.
- WordPress validates the URL, resolving the attacker domain to a public IP.
- Before the HTTP client makes the request, change the DNS record for the attacker domain to point to an internal address.
- The HTTP client re-resolves the hostname and sends the request to the internal address.
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.
A pingback is a WordPress feature where one blog tells another it linked to it; the receiving blog then fetches the linking page to check. The code checked the URL once, but when it actually made the request it looked up the domain name again, and an attacker could change what that name points to in between. This let the server be tricked into contacting internal machines it should not reach.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.