Skip to content
Path traversal Write-up Intermediate

Arbitrary File Read Via Symbolic Links

The ZIP upload service extracted archives without checking for symbolic links, allowing an attacker to include a symlink pointing to a sensitive file on the server. The attacker could then download that file through the separate file-serving service.

Josewice7 Follow

Published on systemweakness.com

Hey, I am W1C3, and today I will explain how you can read files via Symbolic Links. This challenge was developed for the Nullcon CTF 2023.

Josewice7, on systemweakness.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

Likely the ZIP extraction process did not reject symbolic links, allowing them to be extracted and later served.

Impact

An attacker could read arbitrary files on the server, including sensitive files like the flag.

What the attacker needed

Ability to upload a ZIP file; Knowledge of the target file path

The fix

The ZIP extraction should be configured to reject or skip symbolic links, or the extracted files should be validated to ensure they are regular files.

How it was found

  1. Create a symbolic link pointing to the target file.
  2. Create a ZIP archive containing the symbolic link.
  3. Upload the ZIP file to the service.
  4. Receive a URL where the extracted files are accessible.
  5. Download the symbolic link file to read the target file's contents.

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 symbolic link is like a shortcut that points to another file. The upload service unzipped files without checking if any were shortcuts, so an attacker could make a shortcut to a secret file and then download it.

What is Path traversal?

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

More by Josewice7

View all

4 more disclosed reports, best first.

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.