Skip to content
XSS Write-up Beginner

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.

Raunak Gupta Aka B1scuit, 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

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

  1. Enumerate subdomains and filter those returning a 200 status
  2. Notice a subdomain whose registration page says registrations are closed
  3. Run JavaScript recon on that subdomain and find the main.js file
  4. Read the code and find the full API path with variables to register a user
  5. Convert the code into a curl request and replace the name fields with HTML injection payloads
  6. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.