Skip to content
SSRF Write-up Intermediate

One SSRF to Rule Them All

A sandboxed scripting language on a SaaS platform had a function that fetched external URLs, allowing server-side request forgery. The attacker used it to reach Azure instance metadata and steal a managed identity OAuth2 token, which could grant access to the Azure Management API.

infosecwriteups.com

Published on infosecwriteups.com

I was at a coffee shop, laptop open, just starting my day. Nothing special — until I found something more energizing than caffeine.

Ott3rly, 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 scripting language's HTTP fetch function allowed requests to internal IP addresses and custom headers without restricting access to cloud metadata endpoints.

Impact

The stolen token could allow reading Azure resource information and, if the identity had write permissions, creating or modifying cloud infrastructure.

What the attacker needed

Access to the scripting environment; ability to run custom scripts

How it was found

  1. Find the scripting language's HTTP fetch function.
  2. Confirm it can reach external hosts by requesting a public site.
  3. Try cloud metadata endpoints with the required header until one responds.
  4. Request the Azure managed identity token endpoint with the metadata header.
  5. Receive a valid OAuth2 bearer token for the server's identity.

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 platform let users write small scripts, and one built-in command could download data from any web address. Because the server ran that command, an attacker could make the server visit internal cloud addresses that outsiders cannot reach, including a special address that hands out login tokens for the cloud account.

What is SSRF?

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

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.