Text Injection But Make It Spicy: Rendering QR Codes With Unicode Block Characters
A React app concatenated a URL path segment into an i18next translation key and into a CSS class attribute, allowing an attacker to inject text and class names. The author used Unicode block characters and a figure space to render a scannable QR code on the legitimate page, which could be used for phishing.
balintmagyar.com
Published on balintmagyar.com
When the stars stylesheets align just right, it’s possible to escalate a harmless content injection issue to a marginally less harmless one by using certain Unicode characters to stand in for pixels in a QR code. (For fun, not 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 display a convincing QR code on a legitimate domain to phish users, though the author notes it is still only content injection and the target did not fix it.
What the attacker needed
Victim visits a crafted URL; victim scans the QR code; specific fonts and browser
How it was found
- Visit the ticket collection route with a crafted event name containing two opening curly braces to break the translation tag.
- Generate a QR code as Unicode block characters with qrencode.
- Replace unset pixel pairs with U+2007 FIGURE SPACE and URL-encode the whole string.
- Append CSS class names after the curly braces so they are hidden inside the broken translation tag.
- Cycle through the app's CSS classes to find ones that align the QR code lines correctly.
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.
The web page took part of the web address and used it both as a translation lookup and as a CSS class name without cleaning it. By sending special Unicode characters that look like blocks, the researcher made the page display a working QR code made only of text. A victim could scan it and be sent to a malicious site while still trusting the real domain.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.