Cross-site Scripting via WHOIS and DNS Records
Several WHOIS and DNS lookup tools failed to sanitise user-supplied domain registration data, allowing an attacker to inject script that executed when others viewed the lookup results. An attacker could run arbitrary JavaScript in the context of the lookup tool's website.
medium.com
Published on medium.com
On a whim, I tossed this into the address field of the registrant data of a domain so it’d appear in whois records: <script>alert(1);</script>. I figured, what the heck, let’s toss it in a DNS TXT record as well.
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
Root cause
Likely the lookup tools rendered WHOIS and DNS record values without proper output encoding or sanitisation.
Impact
An attacker could execute arbitrary JavaScript in the context of the lookup tool's website when a victim viewed the malicious domain's records.
What the attacker needed
Control of a domain's WHOIS or DNS records; victim uses a vulnerable lookup tool
How it was found
- Put a script tag in the registrant address field of a domain so it appears in WHOIS records.
- Also put a script tag in a DNS TXT record.
- View the domain through WHOIS and DNS lookup tools to see the script execute.
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.
When you look up who owns a domain, the lookup tool shows data that anyone can set, like the registrant's address. If the tool displays that data without cleaning it, a malicious script can run in your browser. This is called cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.