Yahoo bug bounty program – LFI reported and patched!
A local file inclusion flaw on a Yahoo advertiser server let the reporter read server files and, by writing a backdoor into an Apache error log, run commands on the host. The issue was reported and patched within days.
soroush.me
Published on soroush.me
Yahoo! bug bounty program is still young and I believe that they have been pushed to do this when they were not ready for it! Many of their web pages had not even been scanned by an automatic commercial scanner when they started running their bounty program and they will definitely lose profit on that.
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
Likely the page passed user-controlled input straight to a file-include function without restricting which files could be opened.
Impact
An attacker could run arbitrary commands on the server, though the reporter limited testing to a few non-network commands and did not access credential files.
What the attacker needed
Reachable LFI endpoint; guessable log file path; ability to trigger a 400 error
The fix
The issue was fixed by Yahoo after the report.
How it was found
- Find the URL that takes a file path and returns file contents.
- Search for and guess the path of an Apache error log on the FreeBSD host.
- Send a request that causes a 400 error so the request line, containing the backdoor, is written to the log.
- Include the log file through the LFI to execute the backdoor and run commands.
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.
Local file inclusion means a web page takes a file name from the request and opens it on the server, so an attacker can ask for files they should not see. Here the attacker also managed to write text into a log file and then make the page include that log, which turned file reading into running commands on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.