Skip to content
SSRF Write-up Intermediate

How My Life Went from SSRF to LFI (and Why That’s Not a Metapho

A staging API endpoint accepted a user-supplied URL and fetched it without validation, allowing server-side request forgery. The attacker could read local files such as /etc/passwd and environment variables, and potentially access cloud metadata.

iski Follow

Published on infosecwriteups.com

Free Link🎈

Iski, on infosecwriteups.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 endpoint passed the user-controlled redirect parameter directly to a file-fetching function without validating the scheme or destination.

Impact

The endpoint could expose sensitive local files and cloud credentials, potentially leading to further compromise.

What the attacker needed

Access to the staging endpoint; no authentication mentioned

The fix

The report states the security team issued a patch, but does not describe the fix; it should validate and restrict the redirect parameter to allowed URLs.

How it was found

  1. Enumerate subdomains and find a staging API host.
  2. Crawl URLs and filter for parameters like redirect or url.
  3. Test the redirect parameter with localhost and file:// payloads.
  4. Observe that file:///etc/passwd returns the passwd file contents.
  5. Try file:///proc/self/environ and find AWS keys in memory.

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 server had a feature that fetched a web address for you. Because it did not check which addresses were allowed, an attacker could ask it to fetch files on the server itself, like a password file. This is called server-side request forgery, and when it reads local files it becomes local file inclusion.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by iski

View all

186 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.