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.
| Package | Affected versions | Patched versions |
|---|---|---|
com.liferay:com.liferay.layout.type.controller.display.pageMaven | < 3.0.59 | 3.0.59 |
Affected products
2- Liferay/DXPv5Range: 7.4.13
Patches
29bd2ae22416dLPD-50636 Adds test
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</script><svg/onload=alert(origin)>", + layoutTypeController.getFriendlyURL( + mockHttpServletRequest, + _layoutLocalService.getLayout( + layoutPageTemplateEntry.getPlid()))); + } + @Test public void testDisplayPageTypeControllerWithInfoItem() throws Exception { LayoutPageTemplateEntry layoutPageTemplateEntry =
f2621572ca5aLPD-50636 Escape currentURL
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- github.com/advisories/GHSA-3fp2-6mwq-4q3jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-43742ghsaADVISORY
- github.com/liferay/liferay-portal/commit/9bd2ae22416d20f5e8ce2800ea96993c7df98f95ghsaWEB
- github.com/liferay/liferay-portal/commit/f2621572ca5abfe46bad0dca2fa4836deeefa000ghsaWEB
- liferay.atlassian.net/browse/LPE-18192ghsaWEB
- liferay.dev/portal/security/known-vulnerabilities/-/asset_publisher/jekt/content/CVE-2025-43742ghsaWEB
News mentions
0No linked articles in our index yet.