VYPR
Moderate severityNVD Advisory· Published Oct 8, 2025· Updated Oct 8, 2025

CVE-2025-43821

CVE-2025-43821

Description

Cross-site scripting (XSS) vulnerability in the Commerce Product Comparison Table widget in Liferay Portal 7.4.0 through 7.4.3.111, and Liferay DXP 2023.Q4.0 through 2023.Q4.5, 2023.Q3.1 through 2023.Q3.8, and 7.4 GA through update 92 allows remote attackers to inject arbitrary web script or HTML via a crafted payload injected into a Commerce Product's Name text field.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
com.liferay.commerce:com.liferay.commerce.product.serviceMaven
>= 6.0.5, < 6.0.1346.0.134

Affected products

2

Patches

1
433f82c03fac

LPD-3300 sanitize fields

https://github.com/liferay/liferay-portalandrea.ale.sbarraJan 25, 2024via ghsa
2 files changed · +52 0
  • modules/apps/commerce/commerce-product-service/src/main/resources/META-INF/portlet-model-hints.xml+5 0 modified
    @@ -208,22 +208,27 @@
     		<field name="languageId" type="String" />
     		<field name="name" type="String">
     			<hint-collection name="TEXTAREA" />
    +			<sanitize content-type="text/html" modes="ALL" />
     		</field>
     		<field name="shortDescription" type="String">
     			<hint-collection name="TEXTAREA" />
    +			<sanitize content-type="text/html" modes="ALL" />
     		</field>
     		<field name="description" type="String">
     			<hint-collection name="CLOB" />
     			<sanitize content-type="text/html" modes="ALL" />
     		</field>
     		<field name="metaTitle" type="String">
     			<hint name="max-length">255</hint>
    +			<sanitize content-type="text/html" modes="ALL" />
     		</field>
     		<field name="metaDescription" type="String">
     			<hint name="max-length">255</hint>
    +			<sanitize content-type="text/html" modes="ALL" />
     		</field>
     		<field name="metaKeywords" type="String">
     			<hint name="max-length">255</hint>
    +			<sanitize content-type="text/html" modes="ALL" />
     		</field>
     	</model>
     	<model name="com.liferay.commerce.product.model.CPDefinitionOptionRel">
    
  • modules/apps/commerce/commerce-product-test/src/testIntegration/java/com/liferay/commerce/product/service/test/CPDefinitionLocalServiceTest.java+47 0 modified
    @@ -12,6 +12,7 @@
     import com.liferay.commerce.price.list.service.CommercePriceListLocalService;
     import com.liferay.commerce.product.constants.CPInstanceConstants;
     import com.liferay.commerce.product.model.CPDefinition;
    +import com.liferay.commerce.product.model.CPDefinitionLocalization;
     import com.liferay.commerce.product.model.CPInstance;
     import com.liferay.commerce.product.model.CPOption;
     import com.liferay.commerce.product.model.CProduct;
    @@ -357,6 +358,52 @@ public void testAddCPDefinitionWithIgnoreSKUCombinationsAndDefaultInstance()
     		Assert.assertEquals(1, approvedCPInstances);
     	}
     
    +	@Test
    +	public void testAvoidMaliciousCodeInCPDefinitionFields() throws Exception {
    +		frutillaRule.scenario(
    +			"Add product definition with clean fields"
    +		).given(
    +			"I add a product definition"
    +		).when(
    +			"I try to set malicious value in fields"
    +		).then(
    +			"The value is escaped."
    +		);
    +
    +		CPDefinition cpDefinition = CPTestUtil.addCPDefinitionFromCatalog(
    +			_commerceCatalog.getGroupId(), SimpleCPTypeConstants.NAME, false,
    +			false);
    +
    +		String testString =
    +			"'\"></option><img src=x onerror=alert(document.location)>";
    +
    +		CPDefinitionLocalization cpDefinitionLocalization =
    +			_cpDefinitionLocalService.updateCPDefinitionLocalization(
    +				cpDefinition, cpDefinition.getDefaultLanguageId(), testString,
    +				testString, testString, testString, testString, testString);
    +
    +		String expectedString = "'&quot;&gt;<img src=\"x\">";
    +
    +		Assert.assertEquals(
    +			"Expected name", expectedString,
    +			cpDefinitionLocalization.getName());
    +		Assert.assertEquals(
    +			"Expected short description", expectedString,
    +			cpDefinitionLocalization.getShortDescription());
    +		Assert.assertEquals(
    +			"Expected description", expectedString,
    +			cpDefinitionLocalization.getDescription());
    +		Assert.assertEquals(
    +			"Expected metaTitle", expectedString,
    +			cpDefinitionLocalization.getMetaTitle());
    +		Assert.assertEquals(
    +			"Expected metaDescription", expectedString,
    +			cpDefinitionLocalization.getMetaDescription());
    +		Assert.assertEquals(
    +			"Expected metaKeywords", expectedString,
    +			cpDefinitionLocalization.getMetaKeywords());
    +	}
    +
     	@Test
     	public void testClonedProductPriceChangeDoesNotAffectParent()
     		throws PortalException {
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.