Wordpress 4.7 - CSRF -> HTTP SSRF any private ip:port and basic-auth
The WordPress 'Press This' scrape feature could be tricked via CSRF into fetching an attacker-controlled URL, which then redirected the server to any internal IP and port, bypassing the original IP/port filter. An attacker could make the victim's WordPress server send requests to internal services, including with basic-auth credentials.
- Triaged in 5 days
- Fixed in 6 months
- Paid in 7 months
- Disclosed after 12 months
#Description This report is a variant on report #110801 but with broader vector. #110801 was a XSRF SSRF that allowd unintended GET requests to 0.0.0.0 on port 80, 443 and 8080.
This vulnerability uses same entry vector of the press this scrape function but entirely bypasses the ip and port filter allowing the SSRF to any ip, port and appending basic-auth headers.
The ip:port bypass is made by forging a CSRF to wp-admin/press-this.php?u=http://[HOST|IP] with a valid hostname/ip. The valid host will then reply with a crafted header targeting location: http://[privateip]:[port] like 192.168.01, 127.0.01:11211 .. resulting in the final SSRF. The redirect can also include a basic-auth which the server adds as a Authorization header.
#PoC The PoC is very similar to #110801 but with a addition of a valid domain which replies with a redirection header and http code.
Victim has privileges to use press-this of example.com
- Victim has a session running
- Victim gets a payload similar to `
- Victim sends a scrape request to attackers-domain.com
- Attackers domain replies with a 302 and a location header
Location: http://192.168.0.1:12345
- Server blindly follows redirect and the internal ip gets hit.
This can be escalated by adding a basic auth scheme to the redirect url as
Location: http://admin:[email protected]:12345
Listening to the SSRF on 192.168.0.1 would yield a incoming HTTP from the victims server carrying a basic-auth header crafted towards the internal endpoint.
GET / HTTP/1.1
Host: 192.168.0.1:12345
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: Press This (WordPress/4.7-RC1);
Accept: */*
Accept-Encoding: deflate, gzip
Referer: http://admin:[email protected]:12345/
Connection: close
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
Likely the Press This scrape function followed HTTP redirects without re-validating the destination against its IP/port filter, and also forwarded basic-auth credentials from the redirect URL.
Impact
An attacker could use the victim's WordPress server to send requests to any internal IP and port, potentially reaching internal services and including basic-auth credentials in those requests.
What the attacker needed
Victim logged in with Press This privileges; victim visits attacker-controlled page; attacker controls a domain that redirects
How it was found
- Victim with Press This privileges has an active session.
- Attacker delivers a page containing an image tag pointing to the Press This endpoint with the attacker's domain as the URL parameter.
- The victim's browser loads the image, causing a scrape request to the attacker's domain.
- The attacker's domain responds with a 302 redirect to an internal IP and port.
- The WordPress server follows the redirect and sends a 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 report has not been written yet. The Original tab links to the source.
WordPress has a feature that fetches a web page for you when you click 'Press This'. The report shows that an attacker could make a logged-in user's browser silently trigger that fetch to a site the attacker controls, and that site could then tell WordPress to fetch an internal address instead. This lets the attacker probe internal network services through the victim's server.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.