JS Recon To HTML Injection
A subdomain showed a registration page marked as closed, but JavaScript recon revealed a full API endpoint for registering users. Sending names containing HTML markup to that endpoint produced HTML injection.
medium.com
Published on medium.com
Hiyya I am Raunak Gupta, a Security Researcher and Bug Bounty Hunter for fun and profit.
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
Impact
An attacker could inject HTML into the registration flow, though the text does not show what harm that caused beyond the injection itself.
What the attacker needed
Subdomain enumeration; JavaScript file accessible; registration endpoint reachable
How it was found
- Enumerate subdomains and filter those returning a 200 status
- Notice a subdomain whose registration page says registrations are closed
- Run JavaScript recon on that subdomain and find the main.js file
- Read the code and find the full API path with variables to register a user
- Convert the code into a curl request and replace the name fields with HTML injection payloads
- Send the request and confirm the HTML injection
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 website's JavaScript files can contain hidden API addresses that the visible page never shows. The researcher read those files, found the address used to create accounts, and sent it names containing HTML tags. The site displayed those tags as real HTML instead of plain text, which is HTML injection.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.