Skip to content
SSRF Write-up Intermediate

How I Bypassed Giant Swarm’s Nginx Regex to Score a Critical SSRF

The Nginx configuration for the /catalogs endpoint used an unanchored regex to check the url parameter, so any URL containing the whitelisted Google Charts URL anywhere in the string passed the check. An attacker could supply a URL pointing to the AWS metadata IP with the whitelisted URL appended as a query parameter, causing Nginx to proxy the request to the internal metadata service and potentially leak cloud credentials.

sumitshahorg Follow

Published on medium.com

Hello, hunters👾. Most researchers look for critical impact in complex business logic, race conditions, or deep application flows.

Sumit Shah (HackSage), 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

The Nginx configuration used an unanchored case-insensitive regex to validate the url parameter, so any string containing the whitelisted URL anywhere passed the check.

Impact

An attacker could reach the cloud metadata service from inside the infrastructure, potentially leaking IAM credentials and enabling internal reconnaissance; the researcher stopped after confirming the bypass without exfiltrating data.

What the attacker needed

Access to the Happa instance; ability to send HTTP requests

The fix

The fix was to replace the unanchored regex with a strict string equality check on the url parameter.

How it was found

  1. Send a request to the /catalogs endpoint with a url parameter pointing to the AWS metadata IP and the whitelisted Google Charts URL appended as a query parameter.
  2. Nginx checks the url parameter and finds the whitelisted string present, so the regex check passes.
  3. Nginx proxies the request to the internal metadata IP, confirming the SSRF.

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 server-side request forgery (SSRF) bug lets an attacker make the server send requests to places it shouldn't, like internal cloud metadata services. Here, the server tried to allow only one specific URL, but the check was too loose: it only looked for that URL somewhere in the input, not that the input was exactly that URL. By hiding the allowed URL in a query parameter, the attacker could make the server fetch the cloud metadata address instead.

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 sumitshahorg

View all

2 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.