Moderate severityNVD Advisory· Published Aug 23, 2025· Updated Aug 25, 2025
CVE-2025-43770
CVE-2025-43770
Description
A reflected cross-site scripting (XSS) vulnerability in the Liferay Portal 7.4.0 through 7.4.3.131, and Liferay DXP 2024.Q4.0 through 2024.Q4.3, 2024.Q3.1 through 2024.Q3.13, 2024.Q2.0 through 2024.Q2.13, 2024.Q1.1 through 2024.Q1.12 and 7.4 GA through update 92 allows an remote non-authenticated attacker to inject JavaScript into the referer or FORWARD_URL using %00 in those parameters.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
com.liferay.portal:com.liferay.portal.kernelMaven | < 155.0.0 | 155.0.0 |
Affected products
2- Liferay/DXPv5Range: 7.4.13
Patches
2a712758b9c4bLPD-44278: managed unusual but possible cases
2 files changed · +17 −4
portal-kernel/src/com/liferay/portal/kernel/util/HtmlUtil.java+12 −3 modified@@ -401,8 +401,17 @@ public static String escapeJSLink(String link) { link = StringUtil.trim(link); - if (link.contains("javascript:")) { - link = StringUtil.replaceFirst(link, CharPool.COLON, "%3a"); + int pos = link.indexOf(StringPool.COLON); + + if (pos >= 10) { + String protocol = StringUtil.toLowerCase( + link.substring(pos-10, pos)); + + if ("javascript".equals(protocol)) { + return + link.substring(0, pos) + StringUtil.replaceFirst( + link.substring(pos), CharPool.COLON, "%3a"); + } } return link; @@ -915,4 +924,4 @@ private static int _stripTag(char[] tag, String text, int pos) { _VALID_CHARS['_'] = true; } -} \ No newline at end of file +}
portal-kernel/test/unit/com/liferay/portal/kernel/util/HtmlUtilTest.java+5 −1 modified@@ -169,6 +169,10 @@ public void testEscapeJSLink() { Assert.assertEquals( "javascript%3aalert('hello');", HtmlUtil.escapeJSLink("javascript:alert('hello');")); + Assert.assertEquals( + "http://localhost:8080/test?scope='javascript:;'", + HtmlUtil.escapeJSLink( + "http://localhost:8080/test?scope='javascript:;'")); } @Test @@ -409,4 +413,4 @@ protected void assertUnchangedEscape(String input) { Assert.assertEquals(input, HtmlUtil.escape(input)); } -} \ No newline at end of file +}
bf20bc07e3e3LPD-44278 Simplifly and prevent null byte injection
1 file changed · +2 −6
portal-kernel/src/com/liferay/portal/kernel/util/HtmlUtil.java+2 −6 modified@@ -401,12 +401,8 @@ public static String escapeJSLink(String link) { link = StringUtil.trim(link); - if (link.indexOf(StringPool.COLON) == 10) { - String protocol = StringUtil.toLowerCase(link.substring(0, 10)); - - if (protocol.equals("javascript")) { - link = StringUtil.replaceFirst(link, CharPool.COLON, "%3a"); - } + if (link.contains("javascript:")) { + link = StringUtil.replaceFirst(link, CharPool.COLON, "%3a"); } return link;
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-h4m4-xp33-37mjghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-43770ghsaADVISORY
- github.com/liferay/liferay-portal/commit/a712758b9c4b6f4c54df5dec7d334279bb30f75aghsaWEB
- github.com/liferay/liferay-portal/commit/bf20bc07e3e3421d39eaacff052418ce26d791f2ghsaWEB
- liferay.atlassian.net/browse/LPE-18151ghsaWEB
- liferay.dev/portal/security/known-vulnerabilities/-/asset_publisher/jekt/content/CVE-2025-43770ghsaWEB
News mentions
0No linked articles in our index yet.