CVE-2025-43771
Description
Multiple cross-site scripting (XSS) vulnerabilities in the Notifications widget in Liferay Portal 7.4.3.102 through 7.4.3.111, and Liferay DXP 2023.Q4.0 through 2023.Q4.5 and 2023.Q3.1 through 2023.Q3.10 allow remote attackers to inject arbitrary web script or HTML via a crafted payload injected into (1) a user’s “First Name” text field, (2) a user’s “Middle Name” text field, (3) a user’s “Last Name” text field, (4) the “Other Reason” text field when flagging content, or (5) the name of the flagged content.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
com.liferay:com.liferay.flags.webMaven | >= 6.0.23, < 6.0.24 | 6.0.24 |
Affected products
2- Liferay/DXPv5Range: 2023.Q3.1
Patches
41 file changed · +13 −17
modules/apps/flags/flags-test/src/testIntegration/java/com/liferay/flags/web/internal/notifications/test/FlagsUserNotificationHandlerTest.java+13 −17 modified@@ -13,6 +13,7 @@ import com.liferay.message.boards.service.MBMessageLocalServiceUtil; import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; +import com.liferay.portal.kernel.json.JSONUtil; import com.liferay.portal.kernel.model.UserNotificationEvent; import com.liferay.portal.kernel.notifications.UserNotificationDefinition; import com.liferay.portal.kernel.notifications.UserNotificationFeedEntry; @@ -51,15 +52,16 @@ public class FlagsUserNotificationHandlerTest { @Test public void testBodyShouldBeEscaped() throws Exception { + UserNotificationEvent userNotificationEvent = + new UserNotificationEventImpl(); + + String userName = "'\"></option><img src=x onerror=alert(userName)>"; long groupId = TestPropsValues.getGroupId(); + String content = "'\"></option><img src=x onerror=alert(content)>"; ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(groupId); - String userName = "'\"></option><img src=x onerror=alert(userName)>"; - String content = "'\"></option><img src=x onerror=alert(content)>"; - String siteName = "'\"></option><img src=x onerror=alert(siteName)>"; - MBMessage mbMessage = MBMessageLocalServiceUtil.addMessage( null, TestPropsValues.getUserId(), userName, groupId, MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, 0L, @@ -70,13 +72,10 @@ public void testBodyShouldBeEscaped() throws Exception { MBThread mbThread = mbMessage.getThread(); - UserNotificationEvent userNotificationEvent = - new UserNotificationEventImpl(); - - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + String siteName = "'\"></option><img src=x onerror=alert(siteName)>"; userNotificationEvent.setPayload( - jsonObject.put( + JSONUtil.put( "className", MBThread.class.getName() ).put( "classPK", mbThread.getThreadId() @@ -113,13 +112,15 @@ public void testBodyShouldBeEscaped() throws Exception { @Test public void testGetBody() throws Exception { + UserNotificationEvent userNotificationEvent = + new UserNotificationEventImpl(); + long groupId = TestPropsValues.getGroupId(); + String content = "#63;"; ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(groupId); - String content = "#63;"; - MBMessage mbMessage = MBMessageLocalServiceUtil.addMessage( null, TestPropsValues.getUserId(), StringUtil.randomString(), groupId, MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, 0L, @@ -130,13 +131,8 @@ public void testGetBody() throws Exception { MBThread mbThread = mbMessage.getThread(); - UserNotificationEvent userNotificationEvent = - new UserNotificationEventImpl(); - - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - userNotificationEvent.setPayload( - jsonObject.put( + JSONUtil.put( "className", MBThread.class.getName() ).put( "classPK", mbThread.getThreadId()
cca5fe50a5b6LPD-15182 use the escaped value
1 file changed · +1 −1
modules/apps/asset/asset-publisher-web/src/main/java/com/liferay/asset/publisher/web/internal/notifications/AssetPublisherUserNotificationHandler.java+1 −1 modified@@ -58,7 +58,7 @@ protected String getBodyContent(JSONObject jsonObject) { JSONObject assetEntriesJSONObject = contextJSONObject.getJSONObject( "[$ASSET_ENTRIES$]"); - return assetEntriesJSONObject.getString("originalValue"); + return assetEntriesJSONObject.getString("escapedValue"); } protected String getTitle(
0f1f6b628d40LPD-15182 rename method
1 file changed · +7 −7
modules/apps/flags/flags-web/src/main/java/com/liferay/flags/web/internal/notifications/FlagsUserNotificationHandler.java+7 −7 modified@@ -49,22 +49,22 @@ protected String getBody( serviceContext.getLocale(), "a-x-named-x-was-flagged-as-x-by-x", new String[] { - _getOriginalValue( + _getEscapedValue( contextJSONObject.getJSONObject( "[$CONTENT_TYPE$]")), - _getOriginalValue( + _getEscapedValue( contextJSONObject.getJSONObject( "[$CONTENT_TITLE$]")), - _getOriginalValue( + _getEscapedValue( contextJSONObject.getJSONObject("[$REASON|uri$]")), - _getOriginalValue( + _getEscapedValue( contextJSONObject.getJSONObject( "[$REPORTER_USER_NAME$]")) }), _language.format( serviceContext.getLocale(), "inappropriate-content-flagged-in-x", - _getOriginalValue( + _getEscapedValue( contextJSONObject.getJSONObject("[$SITE_NAME$]"))) }); } @@ -80,11 +80,11 @@ protected String getLink( JSONObject contextJSONObject = jsonObject.getJSONObject("context"); - return _getOriginalValue( + return _getEscapedValue( contextJSONObject.getJSONObject("[$CONTENT_URL$]")); } - private String _getOriginalValue(JSONObject jsonObject) { + private String _getEscapedValue(JSONObject jsonObject) { return jsonObject.getString("escapedValue"); }
90b677d7ca74LPD-15182 use the escaped value
1 file changed · +1 −1
modules/apps/flags/flags-web/src/main/java/com/liferay/flags/web/internal/notifications/FlagsUserNotificationHandler.java+1 −1 modified@@ -85,7 +85,7 @@ protected String getLink( } private String _getOriginalValue(JSONObject jsonObject) { - return jsonObject.getString("originalValue"); + return jsonObject.getString("escapedValue"); } @Reference
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
8- github.com/advisories/GHSA-q8fj-76q7-4p7hghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-43771ghsaADVISORY
- github.com/liferay/liferay-portal/commit/0f1f6b628d40c9fc59ad6f561f6bdcc1208b5dbbghsaWEB
- github.com/liferay/liferay-portal/commit/28dc724658e13acb80f30fb3211d0849592ec4efghsaWEB
- github.com/liferay/liferay-portal/commit/90b677d7ca74464f2079266588a67fa56aca842dghsaWEB
- github.com/liferay/liferay-portal/commit/cca5fe50a5b63000c3ca7469b668af9399025e90ghsaWEB
- liferay.atlassian.net/browse/LPE-17917ghsaWEB
- liferay.dev/portal/security/known-vulnerabilities/-/asset_publisher/jekt/content/CVE-2025-43771ghsaWEB
News mentions
0No linked articles in our index yet.