CSS injection in avito.ru via IE11
A search form on avito.ru reflected user input into a CSS context without adequate escaping, allowing an attacker to inject arbitrary CSS. The reporter states this could let an attacker run JavaScript in IE11 via expression(), read page content such as anti-CSRF tokens with CSS selectors, or leak query-string data through a stylesheet import to an attacker domain.
Originally disclosed on HackerOne
- Fixed in 15 hours
- Disclosed after 2.2 years
Hi Team Security @avito
I discovered CSS Injection on avito.ru in form search via IE11
####Description
CSS injection vulnerabilities arise when an application imports a style sheet from a user-supplied URL, or embeds user input in CSS blocks without adequate escaping. They are closely related to cross-site scripting (XSS) vulnerabilities but often trickier to exploit.
Being able to inject arbitrary CSS into the victim's browser may enable various attacks, including :
- Executing arbitrary JavaScript using IE's expression() function.
- Using CSS selectors to read parts of the HTML source, which may include sensitive data such as anti-CSRF tokens.
- Capturing any sensitive data within the URL query string by making a further style sheet import to a URL on the attacker's domain, and monitoring the incoming Referer header.
Affected URL
https://www.avito.ru/rossiya/nedvizhimost?s='><b/style=position:fixed;top:0;left:0;font-size:200px>XSS<!--
####Proof of Concept

####Remediation
Ensure that user input is adequately escaped before embedding it in CSS blocks, and consider using a whitelist to prevent loading of arbitrary style sheets.
####References
Best Regards Hussain Adnan
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the search parameter was embedded into a CSS block without escaping, so injected markup and style rules were interpreted by the browser.
Impact
An attacker could inject arbitrary CSS into a victim's browser, which may enable JavaScript execution in IE11, reading of sensitive page content such as anti-CSRF tokens, or leaking query-string data to an attacker-controlled domain.
What the attacker needed
Victim uses Internet Explorer 11; victim opens a crafted search URL
The fix
User input should be adequately escaped before being embedded in CSS blocks, and a whitelist should be considered to prevent loading of arbitrary style sheets.
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 report has not been written yet. The Original tab links to the source.
A website builds part of its page styling from whatever a visitor types into a search box. If it does not clean that input, an attacker can slip in their own styling rules. In old Internet Explorer those rules could even run code, and in general they can be used to peek at parts of the page or send data to the attacker.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.