Stored HTML Injection to Stored Url Redirection
A notes field stored user-supplied HTML without sanitisation, allowing an attacker to inject a meta refresh tag that silently redirects visitors to an external site. The author could not escalate to stored XSS but achieved persistent open redirection.
Published on medium.com
I found that in target.com the input area (in my case it is notes area in a web app) which value get stored is vulnerable to HTML Injection,
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 application stored user input and rendered it as HTML without sanitising or encoding it, so browser-interpreted tags such as meta refresh were executed.
Impact
Any visitor viewing the affected page could be silently redirected to an attacker-chosen site without interaction, though the author notes HTML injection alone has low impact and stored XSS was not achieved.
What the attacker needed
Ability to write to a stored notes field; victim views the page containing the note
The fix
The application should sanitise or HTML-encode stored user input before rendering it, and ideally disallow meta refresh tags.
How it was found
- Open the notes area of the web app and enter HTML content.
- Save the note and confirm the HTML is rendered rather than shown as text.
- Replace the content with a meta refresh tag pointing to an external site.
- Save again; the stored note now redirects any visitor after the delay.
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 a website saves what you type and shows it to other people without cleaning it first, you can type special formatting codes that the site will treat as real page instructions. Here the author typed a 'refresh' instruction that tells the browser to jump to another website after a couple of seconds. Because the instruction is saved, every visitor to that page gets sent away automatically, without clicking anything.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.