High severityNVD Advisory· Published Jun 16, 2025· Updated Jun 16, 2025
CVE-2025-3526
CVE-2025-3526
Description
SessionClicks in Liferay Portal 7.0.0 through 7.4.3.21, and Liferay DXP 7.4 GA through update 9, 7.3 GA through update 25, and older unsupported versions does not restrict the saving of request parameters in the HTTP session, which allows remote attackers to consume system memory leading to denial-of-service (DoS) conditions via crafted HTTP requests.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
com.liferay.portal:com.liferay.portal.kernelMaven | < 38.0.0 | 38.0.0 |
Affected products
2- Liferay/DXPv5Range: 6.2.0
Patches
3b40fe110eb9dLPS-144246 SF, flip to be consistent
1 file changed · +12 −12
portal-kernel/src/com/liferay/portal/kernel/util/SessionClicks.java+12 −12 modified@@ -148,21 +148,21 @@ public static void put( } private static boolean _isValidKeyValue(String key, String value) { - if ((key.length() > _SESSION_CLICKS_MAX_SIZE_TERMS) || - (value.length() > _SESSION_CLICKS_MAX_SIZE_TERMS)) { - - if (_log.isWarnEnabled()) { - _log.warn( - StringBundler.concat( - "Session clicks has attempted to exceed the maximum ", - "size allowed for keys or values with {key=", key, - ", value=", value, "}")); - } + if ((key.length() <= _SESSION_CLICKS_MAX_SIZE_TERMS) && + (value.length() <= _SESSION_CLICKS_MAX_SIZE_TERMS)) { - return false; + return true; } - return true; + if (_log.isWarnEnabled()) { + _log.warn( + StringBundler.concat( + "Session clicks has attempted to exceed the maximum size ", + "allowed for keys or values with {key=", key, ", value=", + value, "}")); + } + + return false; } private static boolean _isValidSize(int size, String key, String value) {
d9108a12269eLPS-144246 SF, extract common logic
1 file changed · +29 −34
portal-kernel/src/com/liferay/portal/kernel/util/SessionClicks.java+29 −34 modified@@ -85,17 +85,7 @@ public static void put( HttpServletRequest httpServletRequest, String namespace, String key, String value) { - if ((key.length() > _SESSION_CLICKS_MAX_SIZE_TERMS) || - (value.length() > _SESSION_CLICKS_MAX_SIZE_TERMS)) { - - if (_log.isWarnEnabled()) { - _log.warn( - StringBundler.concat( - "Session clicks has attempted to exceed the maximum ", - "size allowed for keys or values with {key=", key, - ", value=", value, "}")); - } - + if (!_isValidKeyValue(key, value)) { return; } @@ -107,18 +97,9 @@ public static void put( int size = portalPreferences.size(); - if (size < _SESSION_CLICKS_MAX_ALLOWED_VALUES) { + if (_isValidSize(size, key, value)) { portalPreferences.setValue(namespace, key, value); } - else { - if (_log.isWarnEnabled()) { - _log.warn( - StringBundler.concat( - "Session clicks has attempted to exceed the ", - "maximum number of allowed values with {key=", - key, ", value=", value, "}")); - } - } break; } @@ -144,17 +125,7 @@ public static void put(HttpSession httpSession, String key, String value) { public static void put( HttpSession httpSession, String namespace, String key, String value) { - if ((key.length() > _SESSION_CLICKS_MAX_SIZE_TERMS) || - (value.length() > _SESSION_CLICKS_MAX_SIZE_TERMS)) { - - if (_log.isWarnEnabled()) { - _log.warn( - StringBundler.concat( - "Session clicks has attempted to exceed the maximum ", - "size allowed for keys or values with {key=", key, - ", value=", value, "}")); - } - + if (!_isValidKeyValue(key, value)) { return; } @@ -168,13 +139,35 @@ public static void put( size++; } - if (size < _SESSION_CLICKS_MAX_ALLOWED_VALUES) { + if (_isValidSize(size, key, value)) { String sessionKey = StringBundler.concat( namespace, StringPool.COLON, key); httpSession.setAttribute(sessionKey, value); + } + } - return; + private static boolean _isValidKeyValue(String key, String value) { + if ((key.length() > _SESSION_CLICKS_MAX_SIZE_TERMS) || + (value.length() > _SESSION_CLICKS_MAX_SIZE_TERMS)) { + + if (_log.isWarnEnabled()) { + _log.warn( + StringBundler.concat( + "Session clicks has attempted to exceed the maximum ", + "size allowed for keys or values with {key=", key, + ", value=", value, "}")); + } + + return false; + } + + return true; + } + + private static boolean _isValidSize(int size, String key, String value) { + if (size < _SESSION_CLICKS_MAX_ALLOWED_VALUES) { + return true; } if (_log.isWarnEnabled()) { @@ -184,6 +177,8 @@ public static void put( "number of allowed values with {key=", key, ", value=", value, "}")); } + + return false; } private static final String _DEFAULT_NAMESPACE =
429834b7cf7cLPS-144246 Add size and number check to put(HttpSession, ...)
1 file changed · +40 −3
portal-kernel/src/com/liferay/portal/kernel/util/SessionClicks.java+40 −3 modified@@ -22,6 +22,7 @@ import com.liferay.portal.kernel.portlet.PortletPreferencesFactoryUtil; import java.util.ConcurrentModificationException; +import java.util.Enumeration; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -143,10 +144,46 @@ public static void put(HttpSession httpSession, String key, String value) { public static void put( HttpSession httpSession, String namespace, String key, String value) { - String sessionKey = StringBundler.concat( - namespace, StringPool.COLON, key); + if ((key.length() > _SESSION_CLICKS_MAX_SIZE_TERMS) || + (value.length() > _SESSION_CLICKS_MAX_SIZE_TERMS)) { + + if (_log.isWarnEnabled()) { + _log.warn( + StringBundler.concat( + "Session clicks has attempted to exceed the maximum ", + "size allowed for keys or values with {key=", key, + ", value=", value, "}")); + } + + return; + } + + Enumeration<String> enumeration = httpSession.getAttributeNames(); + + int size = 0; + + while (enumeration.hasMoreElements()) { + enumeration.nextElement(); + + size++; + } - httpSession.setAttribute(sessionKey, value); + if (size < _SESSION_CLICKS_MAX_ALLOWED_VALUES) { + String sessionKey = StringBundler.concat( + namespace, StringPool.COLON, key); + + httpSession.setAttribute(sessionKey, value); + + return; + } + + if (_log.isWarnEnabled()) { + _log.warn( + StringBundler.concat( + "Session clicks has attempted to exceed the maximum ", + "number of allowed values with {key=", key, ", value=", + value, "}")); + } } private static final String _DEFAULT_NAMESPACE =
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-mf3r-6m25-3867ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-3526ghsaADVISORY
- github.com/liferay/liferay-portal/commit/429834b7cf7c131576f196466a386bb6ce764716ghsaWEB
- github.com/liferay/liferay-portal/commit/b40fe110eb9d264c9c1a79ff77da317bbe6fa528ghsaWEB
- github.com/liferay/liferay-portal/commit/d9108a12269e6b27689b2fd06f66fb881c8ec894ghsaWEB
- liferay.dev/portal/security/known-vulnerabilities/-/asset_publisher/jekt/content/CVE-2025-3526ghsaWEB
News mentions
0No linked articles in our index yet.