Skip to content
Path traversal Write-up Intermediate

Signature Bypass via Control Character Injection → Arbitrary F

The application signed and verified file paths using inconsistent handling: during signing it checked for '..' before sanitising, while during download it used the path directly. An attacker could inject a control character between dots to pass validation, then have it stripped to form a traversal path, allowing access to files outside the public directory.

Ussef Follow

Published on medium.com

Sometimes, the most critical vulnerabilities are not caused by complex logic… but by small inconsistencies in how input is handled.

Ussef, on medium.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

Validation is performed before sanitization, so the input can change after it has been checked.

Impact

An attacker could read any file accessible via path traversal, bypassing access control and exposing sensitive data.

What the attacker needed

Ability to request signed URLs; knowledge of target file path

The fix

The application should sanitize input before validation and use consistent normalized paths for signing and verification.

How it was found

  1. Inject a control character between the dots to bypass the '..' filter.
  2. The sanitization function removes control characters, turning the input back into '..'.
  3. Request a signed URL for the crafted filename; the server signs the normalized path.
  4. Use the normalized path with the valid signature to download the file outside the allowed directory.

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.

The app lets you request a signed link to download a file, but only from a public folder. It tries to block '..' (which means 'go up a folder') but checks for it before cleaning the name. By hiding the dots with a special invisible character, the check passes, then the cleaning turns it back into '..', letting you read secret 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.