VYPR
Moderate severityNVD Advisory· Published Aug 20, 2025· Updated Aug 20, 2025

CVE-2025-43742

CVE-2025-43742

Description

A reflected cross-site scripting (XSS) vulnerability in the Liferay Portal 7.4.0 through 7.4.3.132, and Liferay DXP 2025.Q1.0 through 2025.Q1.3, 2024.Q4.0 through 2024.Q4.7, 2024.Q3.1 through 2024.Q3.13, 2024.Q2.0 through 2024.Q2.13, 2024.Q1.1 through 2024.Q1.14 and 7.4 GA through update 92 allows an remote non-authenticated attacker to inject JavaScript in web content for friendly urls.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
com.liferay:com.liferay.layout.type.controller.display.pageMaven
< 3.0.593.0.59

Affected products

2

Patches

2
9bd2ae22416d

LPD-50636 Adds test

https://github.com/liferay/liferay-portalEudaldo AlonsoMar 4, 2025via ghsa
1 file changed · +34 0
  • modules/apps/layout/layout-type-controller/layout-type-controller-test/src/testIntegration/java/com/liferay/layout/type/controller/display/page/internal/layout/type/controller/test/DisplayPageLayoutTypeControllerTest.java+34 0 modified
    @@ -168,6 +168,40 @@ public void testDisplayPageTypeControllerGetFriendlyURLWithLocale()
     			LocaleUtil.toLanguageId(LocaleUtil.getSiteDefault()));
     	}
     
    +	@Test
    +	public void testDisplayPageTypeControllerGetFriendlyURLWithXSS()
    +		throws Exception {
    +
    +		LayoutTypeController layoutTypeController =
    +			LayoutTypeControllerTracker.getLayoutTypeController(
    +				LayoutConstants.TYPE_ASSET_DISPLAY);
    +
    +		MockHttpServletRequest mockHttpServletRequest =
    +			new MockHttpServletRequest();
    +
    +		mockHttpServletRequest.setAttribute(
    +			WebKeys.CURRENT_URL, "x</script><svg/onload=alert(origin)>");
    +		mockHttpServletRequest.setAttribute(
    +			WebKeys.THEME_DISPLAY,
    +			_getThemeDisplay(
    +				StringPool.BLANK, mockHttpServletRequest,
    +				TestPropsValues.getUser()));
    +
    +		LayoutPageTemplateEntry layoutPageTemplateEntry =
    +			_layoutPageTemplateEntryService.addLayoutPageTemplateEntry(
    +				null, _group.getGroupId(), 0, null,
    +				_portal.getClassNameId(AssetCategory.class.getName()), 0,
    +				RandomTestUtil.randomString(), 0,
    +				WorkflowConstants.STATUS_DRAFT, _serviceContext);
    +
    +		Assert.assertEquals(
    +			"x&lt;/script&gt;&lt;svg/onload=alert(origin)&gt;",
    +			layoutTypeController.getFriendlyURL(
    +				mockHttpServletRequest,
    +				_layoutLocalService.getLayout(
    +					layoutPageTemplateEntry.getPlid())));
    +	}
    +
     	@Test
     	public void testDisplayPageTypeControllerWithInfoItem() throws Exception {
     		LayoutPageTemplateEntry layoutPageTemplateEntry =
    
f2621572ca5a

LPD-50636 Escape currentURL

https://github.com/liferay/liferay-portalEudaldo AlonsoMar 4, 2025via ghsa
1 file changed · +2 1
  • modules/apps/layout/layout-type-controller/layout-type-controller-display-page/src/main/java/com/liferay/layout/type/controller/display/page/internal/layout/type/controller/DisplayPageLayoutTypeController.java+2 1 modified
    @@ -34,6 +34,7 @@
     import com.liferay.portal.kernel.servlet.TransferHeadersHelperUtil;
     import com.liferay.portal.kernel.theme.ThemeDisplay;
     import com.liferay.portal.kernel.util.Constants;
    +import com.liferay.portal.kernel.util.HtmlUtil;
     import com.liferay.portal.kernel.util.HttpComponentsUtil;
     import com.liferay.portal.kernel.util.ParamUtil;
     import com.liferay.portal.kernel.util.Portal;
    @@ -91,7 +92,7 @@ else if (friendlyURL.contains(StringPool.QUESTION)) {
     				0, friendlyURL.lastIndexOf(StringPool.QUESTION));
     		}
     
    -		return friendlyURL;
    +		return HtmlUtil.escape(friendlyURL);
     	}
     
     	@Override
    

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

6

News mentions

0

No linked articles in our index yet.