Miggo Logo

CVE-2025-43821: Liferay Portal is vulnerable to XXS through its Commerce Product's Name text field

N/A

CVSS Score

Basic Information

EPSS Score
0.36234%
Published
10/8/2025
Updated
10/9/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
com.liferay.commerce:com.liferay.commerce.product.servicemaven>= 6.0.5, < 6.0.1346.0.134

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a stored Cross-Site Scripting (XSS) issue originating from the 'Name' field of a Commerce Product. The provided patch addresses this by introducing sanitization for several fields of the CPDefinitionLocalization model, which stores localized product details like the name.

The analysis of the patch commit 433f82c03fac10167f1f811efb482d6010bac6db reveals two key changes:

  1. Configuration Change (portlet-model-hints.xml): The core of the fix lies in this file, where <sanitize content-type="text/html" modes="ALL" /> is added to the name, shortDescription, metaTitle, metaDescription, and metaKeywords fields for the com.liferay.commerce.product.model.CPDefinitionLocalization model. This instructs the Liferay persistence layer to automatically sanitize these fields upon being saved.
  2. Test Case Addition (CPDefinitionLocalServiceTest.java): A new integration test, testAvoidMaliciousCodeInCPDefinitionFields, was added to verify the fix. This test directly invokes _cpDefinitionLocalService.updateCPDefinitionLocalization with a malicious XSS payload. It then asserts that the values stored in the resulting CPDefinitionLocalization object are properly sanitized.

The test case provides clear evidence that updateCPDefinitionLocalization is the function responsible for processing the potentially malicious input. While the function's own source code isn't modified in the patch, it is the entry point for the vulnerable data. The vulnerability existed because this service method would persist the data as-is, and the fix ensures that when this method is called, the underlying model's new sanitization rules are applied. Therefore, com.liferay.commerce.product.service.CPDefinitionLocalService.updateCPDefinitionLocalization is the key function that would appear in a runtime profile during the exploitation of this vulnerability, as it's the one processing and persisting the tainted input.

Vulnerable functions

com.liferay.commerce.product.service.CPDefinitionLocalService.updateCPDefinitionLocalization
modules/apps/commerce/commerce-product-service/src/main/java/com/liferay/commerce/product/service/impl/CPDefinitionLocalServiceImpl.java
This function is responsible for creating or updating localized product definitions, including the product's name. Before the patch, this function would save the raw input for fields like `name` and `shortDescription` without proper sanitization. An attacker could provide a malicious payload (e.g., JavaScript) in these fields. When the product information was later displayed in components like the 'Commerce Product Comparison Table widget', the malicious script would execute in the user's browser, leading to a stored Cross-Site Scripting (XSS) vulnerability. The patch mitigates this by adding a sanitization rule at the model level, ensuring that any HTML/script content provided to this function is neutralized before being stored.

WAF Protection Rules

WAF Rule

*ross-sit* s*riptin* (XSS) vuln*r**ility in t** *omm*r** Pro*u*t *omp*rison T**l* wi***t in Li**r*y Port*l *.*.* t*rou** *.*.*.***, *n* Li**r*y *XP ****.Q*.* t*rou** ****.Q*.*, ****.Q*.* t*rou** ****.Q*.*, *n* *.* ** t*rou** up**t* ** *llows r*mot* *

Reasoning

T** vuln*r**ility is * stor** *ross-Sit* S*riptin* (XSS) issu* ori*in*tin* *rom t** 'N*m*' *i*l* o* * *omm*r** Pro*u*t. T** provi*** p*t** ***r*ss*s t*is *y intro*u*in* s*nitiz*tion *or s*v*r*l *i*l*s o* t** `*P***initionLo**liz*tion` mo**l, w*i** st