Reflected Cross-Site Scripting (XSS) in Revive Adserver 5.5.2
The compact parameter in the admin search page was written into a hidden form field without escaping, so a crafted link could run script in an administrator's browser. An attacker who got an admin to open the link could read session cookies and act as that admin.
- Triaged in 7 hours
- Fixed in 44 days
- Disclosed after 6 months
A reflected Cross-Site Scripting (XSS) vulnerability has been identified in Revive Adserver version 5.5.2. This vulnerability allows an attacker to inject malicious JavaScript code into the application, which is then executed in the context of the victim's browser. The vulnerability is present in the admin-search.php file and can be exploited via the compact parameter.
The vulnerability arises due to insufficient input sanitization of the compact parameter in the admin-search.php file. The compact parameter is directly embedded into the HTML output without proper escaping, allowing an attacker to inject arbitrary JavaScript code. The affected code is located in lib/templates/admin/layout/search.html:
<input type='hidden' name='compact' value='{$compact}'>
The compact parameter is passed to the template without proper sanitization in www/admin/admin-search.php:
phpAds_registerGlobalUnslashed('keyword', 'client', 'campaign', 'banner', 'zone', 'affiliate', 'compact');
...
if (!isset($compact)) {
$compact = false;
}
...
$oTpl->assign('compact', $compact);
Proof of Concept (POC)
An attacker can exploit this vulnerability by crafting a malicious URL that includes a JavaScript payload in the compact parameter. When the administrator visits this URL, the malicious script is executed in their browser.
http://target-ip/www/admin/admin-search.php?affiliate=1&banner=1&campaign=1&client=1&compact=1'><script>alert(document.cookie)</script>&keyword=1&zone=1
Impact
The impact of this vulnerability is significant as it allows an attacker to: Steal sensitive information such as session cookies. Perform actions on behalf of the victim. Redirect the victim to malicious websites. Deface the application. This vulnerability can be exploited by any user who can trick a victim into clicking a malicious link, making it a critical security issue that requires immediate attention.
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
The compact parameter was registered as a global and assigned to the template without output escaping, so it was rendered raw inside an HTML attribute.
Impact
An attacker could steal session cookies, perform actions as the victim, redirect them to malicious sites and deface the application.
What the attacker needed
Victim is a logged-in admin; victim clicks a crafted link
How it was found
- Craft a URL for the admin search page that puts a script payload in the compact parameter.
- Send the link to an administrator and get them to open it.
- The payload breaks out of the hidden field and the script runs in the admin's browser.
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 web page sometimes puts text from the address bar straight into its HTML. Here the search page copied a value called compact into a hidden form field without cleaning it, so a link could carry extra markup that the browser treats as code. When an administrator opens that link, the code runs with the administrator's logged-in powers.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.