Skip to content
SSRF Write-up Advanced

WordPress Core - Unauthenticated Blind SSRF

WordPress's pingback feature validated a user-supplied URL and then re-resolved the hostname when making the request, allowing an attacker to change DNS between check and use. An unauthenticated attacker could make the server send HTTP requests to internal or external addresses, enabling blind SSRF.

Simon Scannell Follow

Published on blog.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.

Simon Scannell (@scannell_simon), Thomas Chauchefoin (@swapgs), on blog.sonarsource.com

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 once, but the hostname was resolved again when the HTTP request was made, so the validated IP and the used IP could differ (a time-of-check-time-of-use flaw).

Impact

The impact is low on its own; it could ease exploitation of other vulnerabilities in the internal network, such as Confluence OGNL injection or Jenkins RCE, but requires chaining.

What the attacker needed

Pingback.ping enabled (default); attacker controls a domain's DNS; ability to change DNS between check and use

The fix

The fix should persist the validated IP addresses and use them for the request; WordPress introduced a second argument to wp_http_validate_url() to pass the validated IPs by reference.

How it was found

  1. Send an XML-RPC request invoking the pingback.ping method with a pagelinkedfrom URL pointing to an attacker-controlled domain.
  2. The domain initially resolves to a public IP so wp_http_validate_url passes.
  3. Change the DNS record to point to an internal address before the HTTP client resolves it again.
  4. The server then sends the pingback 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 feature where one blog tells another it linked to it, and WordPress does this by fetching a URL. The code checked the URL was safe, but then looked up the domain name again later, so an attacker could change what that name points to in between. This let them make the WordPress server visit addresses it should not, like internal services.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More from WordPress

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.