Skip to content
Path traversal Write-up Intermediate

Yahoo Bug Bounty Part 1 - 台灣 Yahoo Blog 任意檔案下載漏洞

The Yahoo Blog backup download endpoint took a filename from the query string and used it in a file path without validation, so an attacker could read files outside the intended backup directory. By guessing the web server configuration path, the attacker could read configuration files and PHP source code, and could potentially download other users' blog backups.

blog.orange.tw

Published on blog.orange.tw

Yahoo 開始有了 Bug Bounty 制度! 緣起也滿有趣的,國外有個資安專家找到 Yahoo 的 XSS 漏洞結果回報後只得到 $12.50 Yahoo Company Store 優惠卷,結果當然� 不爽的,只好 po 個 爆料文 XDDD

The author, on blog.orange.tw

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

Impact

An attacker could read files outside the backup directory, including web server configuration and PHP source code, and with knowledge of the backup path structure could potentially download other users' blog backups.

What the attacker needed

No account needed to reach the endpoint; knowledge of the backup path structure

How it was found

  1. Request the backup download URL with the filename parameter set to the user's own backup name.
  2. Change the filename to a relative path starting with './' and observe that the download still works.
  3. Try reading system files such as the password file, which fails, but files under /tmp can be read.
  4. Request the filename as a single dot and as a slash to learn how the server builds the path and what it returns.
  5. Guess the web server configuration path and request it through the filename parameter to read the configuration file.
  6. Read the PHP source code of the download script to confirm the missing validation and the backup path structure.

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 web page that offers file downloads often takes the file name from the address bar. If the server trusts that name and joins it to a folder path without checking it, someone can use '..' to climb out of the intended folder and read other files on the server. This is called path traversal, and here it let the researcher read configuration and source code files.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.