Finding multiple SSRF with aws metadata access on A BANK system
Several subdomains exposed a tax-invoice endpoint that accepted a URL parameter and fetched it server-side, allowing the author to reach the AWS instance metadata service. The author claims to have extracted AWS credentials and used them to access production customer data.
Published on notifybugme.medium.com
My name is Santosh Kumar Sha, I’m a security researcher from India(Assam). In this article, I will be describing How I was able Find multiple SSRF with aws metadata access ON a BANK System and Get access to there production server.
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.
Context
Santosh Kumar Sha, a security researcher from Assam, India, describes how he found multiple SSRF vulnerabilities with AWS metadata access on a bank system and used them to reach the bank's production server metadata, where customer data was visible. The target is referred to as example.com throughout, because the bank had no responsible disclosure programme and no bug bounty programme. The researcher reports that he submitted 15 SSRF AWS metadata access bugs plus many other critical bugs, and that the bank did not even say thank you.
The feature at the centre of the write-up is an endpoint called getTaxinvoice.jsp, which serves tax invoice data. On the main application it was used by several functions, including product tax invoice and sell tax invoice. The researcher's reasoning was that if one function used this endpoint for tax invoice data, other functions on other subdomains probably did too, and any of them might accept a user-controlled URL.
Setup
The researcher worked without any programme scope, starting from the main domain. The tools listed are:
- Subfinder (https://github.com/projectdiscovery/subfinder)
- httpx (https://github.com/projectdiscovery/httpx)
- gau (Corben) (https://github.com/lc/gau)
- waybackurls (tomnomnom) (https://github.com/tomnomnom/waybackurls)
No versions are given. The workflow relies on internet archive data (waybackurls and gau) to enumerate subdomains and URLs, and on Burp for manual testing of the main domain. A wordlist of candidate parameter names is referenced at /root/magicparameter/ssrf.txt.
Finding it
After a couple of hours of manual testing on the main domain with Burp, the researcher noticed the endpoint getTaxinvoice.jsp. It stood out because it handled tax invoice data and was reused by several functions (product tax invoice, sell tax invoice). That reuse suggested that one or more of those functions might pass a user-supplied value into the endpoint in a way that could be abused for SSRF.
Fuzzing the main application for a vulnerable parameter produced no success. Because the endpoint was known to be used by other functions, the researcher decided to collect every URL containing the endpoint from waybackurls, gau and internet archive, and then test the endpoint across all of those paths and subdomains.
Exploitation
Step 1: subdomain and URL collection
The first pass gathered subdomains from internet archives:
subfinder -d example.com silent
gau -subs example.com
waybackurls example.com
To avoid missing subdomains, the researcher piped subfinder into waybackurls so that URLs belonging to every discovered subdomain were also collected. The final collection commands, filtered to URLs containing =, were:
gau -subs example.com | grep "=" >> vul1.txt
waybackurls example.com | grep "=" >> vul2.txt
subfinder -d example.com -silent | gau -subs | grep "=" >> vul3.txt
The grep "=" filter keeps only URLs that carry parameters, which are the interesting ones for parameter-based SSRF. The three files were then merged and de-duplicated:
cat vul1.txt vul2.txt vul3.txt | sort -u >> unique_sub.txt
Step 2: reducing URLs to endpoint paths
From the unique URL list, the researcher extracted just the path portion, stripping the host and the query string:
cat unique_sub.txt | sed 's/^.*.com//' | sed 's/?.*//' >> endpoint_path.txt
The first sed removes everything up to and including .com, and the second removes everything from ? onwards. The report gives the shape of the result as paths such as /store/tax and /payment/invoice.
Step 3: appending the known endpoint to every path
Each collected path was then suffixed with the endpoint of interest:
cat endpoint_path.txt | sed 's/$/\/getTaxinvoice.jsp/'
This produces candidate URLs of the form <path>/getTaxinvoice.jsp across all the subdomains and paths seen in the archives, which is how the researcher expected to reach the other functions that reuse the endpoint.
Step 4: spraying candidate parameter names with an SSRF payload
The candidate URLs were tested against every parameter name in the SSRF wordlist, with the value set to the EC2 instance metadata hostname endpoint:
xargs -a /root/magicparameter/ssrf.txt -I@ bash -c 'for url in $(cat endpoint_path.txt | sed "s/$/\/getTaxinvoice.jsp/"); do echo "http://$url?@=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data/hostname";done' | httpx -silent -status-code -content-length -extract-regex "[redacted]"
Each wordlist entry is substituted for @ in the query string, so every candidate URL is requested once per parameter name with the value http://[redacted]/latest/meta-data/hostname (URL-encoded). The link-local address [redacted] is the EC2 instance metadata service. httpx sends the requests and extracts anything matching [redacted], which is the suffix of the internal hostname returned by the metadata service, so a hit shows up directly in the output.
This produced 6 more SSRF findings on different subdomains using the same endpoint and path.
Step 5: extracting credentials and reaching production data
With the SSRF confirmed, the researcher extracted the AWS access key and secret from the metadata service. Using those keys, he accessed the production server metadata, where he could see the customer data for the bank. The report describes the data as 100GB of customer high-profile data. The screenshot shows the result of that access.

Step 6: reporting
Reporting was difficult because there was no email address, security disclosure programme or bug bounty programme. The researcher eventually found the security team's email and reported the bug. The next day the head of the security team called to say they would work on fixing it.
Root cause
The report does not show the server-side code, so the exact mistake is not documented. What the behaviour implies is that getTaxinvoice.jsp accepted a user-controlled URL in a request parameter and fetched it server-side without restricting the destination, so the server could be pointed at the link-local metadata address. Because the same endpoint was reused by several functions across subdomains, the same flaw existed in multiple places, which is why the same technique yielded six more findings.
The report does not describe any allowlist, egress filtering or metadata service hardening (such as IMDSv2) that would have stopped the request, so why existing defences did not stop it is not stated.
Impact
Under the conditions described, an attacker who can reach the vulnerable endpoint with the right parameter can make the bank's server issue requests to the EC2 metadata service. That yields the instance's internal hostname, and in this case the AWS access key and secret. With those credentials the researcher reached production server metadata and could see customer data for the bank, described in the report as 100GB of customer high-profile data. The bank's customers would have suffered had the access fallen into the hands of bad actors, which is why the researcher reported the issues despite there being no programme and no reward.
Fix
The security team head said they would work on fixing it, and no further detail on the remediation is given.
Variants to test
- Reused endpoints across subdomains: take an endpoint seen on the main application and append it to every path collected from waybackurls and gau, then test each resulting URL. A positive result is a response whose body or extracted regex contains metadata content such as
[redacted]. - Parameter-name spraying: run the same URL list against a wordlist of parameter names with the metadata hostname as the value. A positive result is any parameter that causes the server to fetch the link-local address.
- Archive-derived parameter discovery: filter archived URLs with
grep "="to keep only parameterised URLs, then test those parameters directly. A positive result is a parameter that accepts a full URL and returns content from it. - Metadata path probing: once a parameter is found, request other metadata paths under
[redacted]to see how much is reachable. A positive result is any metadata response beyond the hostname, such as credential material. - Credential use: if keys are returned, test them only within the authorised scope of the engagement. A positive result is authenticated access to resources the keys were not meant to expose.
Takeaway
The researcher's point is that many hunters have seen this process, but his approach was to find one interesting endpoint and automate the search for it across every archived path and subdomain, which turned a single lead into multiple vulnerable targets. Bug bounty, in his view, is not always about money: it is also about helping a company fix its bugs, even when the company does not say thank you.

What happened, in plain words
A security researcher from Assam, India, named Santosh Kumar Sha, was looking at a bank's website. He found a page on the bank's server that could be tricked into fetching another address on the bank's behalf. That kind of trick is called SSRF, short for Server-Side Request Forgery. The address he made the server fetch was a special internal address that only machines inside Amazon's cloud can reach, and that address hands out information about the machine. With those keys he reached the bank's production server metadata and could see customer data. He calls the target example.com throughout because the bank had no responsible disclosure programme and no bug bounty programme, so he did not want to name it.
He reports that he submitted 15 SSRF bugs of this kind plus many other critical bugs, and that the bank did not even say thank you. The write-up is about how he turned one interesting page into several working findings by automating the search across everything the internet archives had recorded about the bank's domains.
The feature at the centre of it
The page he noticed is called getTaxinvoice.jsp. A .jsp file is a page that runs on the server and produces a web page, a bit like a form letter that the server fills in before sending it to your browser. This particular page serves tax invoice data. On the main application it was used by several functions, including product tax invoice and sell tax invoice.
His reasoning was simple: if one function used this page to get tax invoice data, other functions on other subdomains probably used it too, and any one of them might accept a web address supplied by the user. If the server then goes and fetches that address, you have SSRF.
A subdomain is a smaller name under a main name. If the main site is example.com, then shop.example.com and pay.example.com are subdomains. Banks usually have many, one per service.
The tools he used
He worked without any programme scope, starting from the main domain. The tools listed are:
- Subfinder (https://github.com/projectdiscovery/subfinder)
- httpx (https://github.com/projectdiscovery/httpx)
- gau (Corben) (https://github.com/lc/gau)
- waybackurls (tomnomnom) (https://github.com/tomnomnom/waybackurls)
No versions are given. In plain terms:
- Subfinder finds subdomains for a domain name by asking public sources.
- gau and waybackurls pull old URLs out of internet archives. The internet archive is a public record of pages that have been seen on the web over the years, like an old newspaper collection for websites. Even pages that no longer exist are often still listed there.
- httpx sends web requests to a list of addresses and reports what came back, such as the status code and the size of the response.
- Burp is a tool that sits between your browser and a website so you can look at and change every request by hand. He used it for manual testing of the main domain.
He also references a wordlist of candidate parameter names at /root/magicparameter/ssrf.txt. A parameter is the part of a web address after the ? that carries a name and a value, like ?colour=blue. A wordlist is just a text file with one candidate name per line.
Finding it
After a couple of hours of manual testing on the main domain with Burp, he noticed the endpoint getTaxinvoice.jsp. It stood out because it handled tax invoice data and was reused by several functions (product tax invoice, sell tax invoice). That reuse suggested that one or more of those functions might pass a user-supplied value into the page in a way that could be abused for SSRF.
Fuzzing the main application for a vulnerable parameter produced no success. Fuzzing means trying many variations automatically to see which one behaves differently. Because the page was known to be used by other functions, he decided to collect every URL containing the page from waybackurls, gau and internet archive, and then test the page across all of those paths and subdomains.
Exploitation
Step 1: subdomain and URL collection
The first pass gathered subdomains from internet archives:
subfinder -d example.com silent
gau -subs example.com
waybackurls example.com
Line by line:
subfinder -d example.com silentasks Subfinder to list subdomains ofexample.com. Thesilentpart keeps the output to just the names, without banners or extra noise.gau -subs example.comasks gau to fetch known URLs forexample.comand its subdomains (-subsmeans include subdomains).waybackurls example.comdoes the same kind of job with a different tool, pulling URLs from the archive for the domain.
To avoid missing subdomains, he piped subfinder into waybackurls so that URLs belonging to every discovered subdomain were also collected. A pipe, the | symbol, means take the output of the command on the left and feed it as input to the command on the right, like passing a bucket down a line. The final collection commands, filtered to URLs containing =, were:
gau -subs example.com | grep "=" >> vul1.txt
waybackurls example.com |grep "=" >> vul2.txt
subfinder -d example.com -silent | gau -subs | grep "=" >> vul3.txt
Line by line:
gau -subs example.com | grep "=" >> vul1.txtgets archived URLs, keeps only the lines that contain an equals sign, and appends them to a file calledvul1.txt. The>>means append to the file rather than overwrite it.waybackurls example.com |grep "=" >> vul2.txtdoes the same with the other archive tool and writes tovul2.txt.subfinder -d example.com -silent | gau -subs | grep "=" >> vul3.txtfirst lists subdomains, then feeds those names into gau so it fetches archived URLs for each subdomain, then keeps only lines with an equals sign and appends them tovul3.txt.
The grep "=" filter keeps only URLs that carry parameters, which are the interesting ones for parameter-based SSRF. A URL without a parameter has nothing for you to control, so there is nothing to test. The three files were then merged and de-duplicated:
cat vul1.txt vul2.txt vul3.txt | sort -u >> unique_sub.txt
Line by line:
cat vul1.txt vul2.txt vul3.txtprints the contents of all three files one after another.sort -usorts the lines and removes duplicates (-umeans unique).>> unique_sub.txtappends the result to a new file calledunique_sub.txt.
Step 2: reducing URLs to endpoint paths
From the unique URL list, he extracted just the path portion, stripping the host and the query string:
cat unique_sub.txt | sed 's/^.*.com//' | sed 's/?.*//' >> endpoint_path.txt
Line by line:
cat unique_sub.txtprints the list of unique URLs.sed 's/^.*.com//'is a find-and-replace. It removes everything from the start of the line up to and including.com, leaving what comes after the domain.sed 's/?.*//'removes everything from the?onwards, which is the query string.>> endpoint_path.txtappends the result to a file.
The report gives the shape of the result as paths such as /store/tax and /payment/invoice. In other words, he now had a list of the paths that exist on the site, without the domain and without the parameters.
Step 3: appending the known endpoint to every path
Each collected path was then suffixed with the page of interest:
cat endpoint_path.txt | sed 's/$/\/getTaxinvoice.jsp/'
Line by line:
cat endpoint_path.txtprints the list of paths.sed 's/$/\/getTaxinvoice.jsp/'replaces the end of each line ($means end of line) with/getTaxinvoice.jsp. The backslash before the slash is there because the slash is also the separator used bysed, so it has to be escaped.
This produces candidate URLs of the form <path>/getTaxinvoice.jsp across all the subdomains and paths seen in the archives, which is how he expected to reach the other functions that reuse the page.
Step 4: spraying candidate parameter names with an SSRF payload
The candidate URLs were tested against every parameter name in the SSRF wordlist, with the value set to the EC2 instance metadata hostname endpoint:
xargs -a /root/magicparameter/ssrf.txt -I@ bash -c 'for url in $(cat endpoint_path.txt | sed "s/$/\/getTaxinvoice.jsp/"); do echo "http://$url?@=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data/hostname";done' | httpx -silent -status-code -content-length -extract-regex "[redacted]"
Line by line:
xargs -a /root/magicparameter/ssrf.txt -I@reads the wordlist file and, for each line, runs the following command with@replaced by that line. So if the wordlist contains a name likeurl, the command runs once with@set tourl, then again with the next name, and so on.bash -c '...'runs the quoted script for each of those names.for url in $(cat endpoint_path.txt | sed "s/$/\/getTaxinvoice.jsp/"); do ... doneloops over every path, appends/getTaxinvoice.jspto it, and runs the body once per resulting URL.echo "http://$url?@=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data/hostname"prints a full URL: the candidate path, then a?, then the parameter name (the current wordlist entry), then=, then the value. The value ishttp://[redacted]/latest/meta-data/hostnamewritten in URL-encoded form, where%3Ais a colon and%2Fis a slash. Encoding matters because a raw:and/inside a parameter value can confuse parsers.| httpx -silent -status-code -content-length -extract-regex "[redacted]"sends each printed URL with httpx.-silentkeeps the output clean,-status-codeand-content-lengthreport the response code and size, and-extract-regex "[redacted]"pulls out anything in the response that matches that text.
Why this works: [redacted] is a special address that only the machine itself can reach. In Amazon's cloud it is the metadata service, a small internal service that answers questions about the machine it runs on. One of the things it can return is the machine's internal hostname, which ends in [redacted]. If the bank's server fetches the address for you and the answer comes back, the extracted text shows up in the output. That is the signal that the server made the request on your behalf.
This produced 6 more SSRF findings on different subdomains using the same page and path.
Step 5: extracting credentials and reaching production data
With the SSRF confirmed, he extracted the AWS access key and secret from the metadata service. An access key and secret are like a username and password for a cloud account: whoever holds them can act as that account. Using those keys, he accessed the production server metadata, where he could see the customer data for the bank. The report describes the data as 100GB of customer high-profile data. The screenshot shows the result of that access.

Step 6: reporting
Reporting was difficult because there was no email address, security disclosure programme or bug bounty programme. A responsible disclosure programme is a published way for outsiders to report security problems safely; a bug bounty programme pays for such reports. He eventually found the security team's email and reported the bug. The next day the head of the security team called to say they would work on fixing it.
Why it worked
The report does not show the server-side code, so the exact mistake is not documented. What the behaviour implies is that getTaxinvoice.jsp accepted a web address in a request parameter and fetched it server-side without restricting where it could go, so the server could be pointed at the internal metadata address. Because the same page was reused by several functions across subdomains, the same flaw existed in multiple places, which is why the same technique yielded six more findings.
The report does not describe any allowlist, egress filtering or metadata service hardening (such as IMDSv2) that would have stopped the request, so why existing defences did not stop it is not stated. An allowlist would be a list of addresses the server is permitted to fetch; egress filtering would block outbound traffic to internal addresses; IMDSv2 is a newer version of the metadata service that requires a session token before answering.
What it means
Under the conditions described, someone who can reach the vulnerable page with the right parameter can make the bank's server issue requests to the metadata service. That yields the machine's internal hostname, and in this case the AWS access key and secret. With those credentials he reached production server metadata and could see customer data for the bank, described in the report as 100GB of customer high-profile data. The bank's customers would have suffered had the access fallen into the hands of bad actors, which is why he reported the issues despite there being no programme and no reward.
What was fixed
The security team head said they would work on fixing it, and no further detail on the remediation is given.
Things to try on your own targets
- Reused pages across subdomains: take a page seen on the main application and append it to every path collected from waybackurls and gau, then test each resulting URL. A positive result is a response whose body or extracted text contains metadata content such as
[redacted]. - Parameter-name spraying: run the same URL list against a wordlist of parameter names with the metadata hostname as the value. A positive result is any parameter that causes the server to fetch the internal address.
- Archive-derived parameter discovery: filter archived URLs with
grep "="to keep only parameterised URLs, then test those parameters directly. A positive result is a parameter that accepts a full web address and returns content from it. - Metadata path probing: once a parameter is found, request other metadata paths under
[redacted]to see how much is reachable. A positive result is any metadata response beyond the hostname, such as credential material. - Credential use: if keys are returned, test them only within the authorised scope of the engagement. A positive result is authenticated access to resources the keys were not meant to expose.
Takeaway
His point is that many hunters have seen this process, but his approach was to find one interesting page and automate the search for it across every archived path and subdomain, which turned a single lead into multiple vulnerable targets. Bug bounty, in his view, is not always about money: it is also about helping a company fix its bugs, even when the company does not say thank you.

Glossary
- SSRF (Server-Side Request Forgery): a flaw where a server can be made to fetch a web address chosen by the user, instead of only addresses it should use.
- Endpoint: a specific page or address on a server that performs a function, such as
getTaxinvoice.jsp. - Subdomain: a smaller name under a main domain, such as
shop.example.comunderexample.com. - Parameter: the name and value part of a web address after the
?, like?colour=blue. - Query string: everything in a web address from the
?onwards. - Wordlist: a text file with one candidate value per line, used to try many options automatically.
- Fuzzing: trying many variations automatically to see which one behaves differently.
- Internet archive: a public record of pages and URLs seen on the web over time.
- Pipe (
|): passing the output of one command as input to the next. sed: a command-line tool that finds and replaces text.grep: a command-line tool that keeps only lines matching a pattern.xargs: a command-line tool that runs a command once per line of input, substituting the line where you put a placeholder.- httpx: a tool that sends web requests to a list of addresses and reports the responses.
- Burp: a tool that sits between your browser and a website so you can inspect and change requests by hand.
- Metadata service: an internal service in cloud platforms that answers questions about the machine it runs on, reachable at
[redacted]in Amazon's cloud. - Link-local address: an address that only works on the local network segment, not across the internet.
- AWS access key and secret: a pair of credentials, like a username and password, that grant access to a cloud account.
- Production server: the live machine that serves real customers, as opposed to a test machine.
- Responsible disclosure programme: a published way for outsiders to report security problems safely.
- Bug bounty programme: a programme that pays researchers for valid security reports.
- Allowlist: a list of things that are explicitly permitted, such as addresses a server may fetch.
- Egress filtering: blocking or restricting outbound traffic from a server.
- IMDSv2: a newer version of the cloud metadata service that requires a session token before answering.
- URL encoding: writing special characters in a web address in a safe form, such as
%3Afor a colon and%2Ffor a slash.