Skip to main content
Vulnerability Database/CVE-2024-25609

CVE-2024-25609: Liferay DXP CSRF Redirect Vulnerability

CVE-2024-25609 is a CSRF vulnerability in Liferay Digital Experience Platform allowing attackers to redirect users to malicious URLs. This article covers the technical details, affected versions, security impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-25609 Overview

CVE-2024-25609 is an open redirect vulnerability [CWE-601] in Liferay Portal and Liferay Digital Experience Platform (DXP). The HtmlUtil.escapeRedirect function fails to properly sanitize URLs that begin with two forward slashes. Attackers can abuse this flaw to redirect authenticated or unauthenticated users to arbitrary external domains. The vulnerability affects the redirect parameter, the FORWARD_URL parameter, and other parameters that depend on HtmlUtil.escapeRedirect for validation. This issue is an incomplete fix for the earlier CVE-2022-28977.

Critical Impact

Remote attackers can craft malicious URLs that redirect Liferay users to attacker-controlled sites, enabling phishing and credential theft campaigns against trusted Liferay deployments.

Affected Products

  • Liferay Portal 7.2.0 through 7.4.3.12 (and older unsupported versions)
  • Liferay DXP 7.4 before update 9, 7.3 service pack 3, 7.2 fix pack 15 through 18
  • Older unsupported Liferay DXP versions

Discovery Timeline

  • 2024-02-20 - CVE-2024-25609 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-25609

Vulnerability Analysis

The flaw lives in Liferay's HtmlUtil.escapeRedirect method, which is intended to enforce that redirect targets remain within the Liferay application. The function strips or rejects absolute URLs beginning with a scheme such as http:// or https://. However, the sanitization logic does not account for scheme-relative URLs beginning with //. Browsers interpret //attacker.example as a scheme-relative reference and resolve it against the current scheme, producing a fully external navigation.

An attacker who delivers a Liferay URL containing a redirect or FORWARD_URL parameter pointing to //attacker.example can send victims to any external host while preserving the trusted Liferay domain in the initial request. This defeats user-facing URL inspection and enables credential-harvesting pages that mimic the Liferay login flow.

Root Cause

The root cause is incomplete input validation in HtmlUtil.escapeRedirect. The original fix delivered in CVE-2022-28977 blocked common absolute URL patterns but did not normalize or reject sequences of leading slashes. Any Liferay controller that trusts the return value of HtmlUtil.escapeRedirect inherits the bypass.

Attack Vector

Exploitation requires user interaction. The attacker crafts a URL on a legitimate Liferay host containing a redirect parameter whose value begins with //. The victim clicks the link, authenticates or interacts with the trusted Liferay instance, and is then redirected to the attacker-controlled destination. The vulnerability is network-reachable and requires no privileges on the Liferay server.

See the Liferay CVE-2024-25609 advisory for vendor technical details.

Detection Methods for CVE-2024-25609

Indicators of Compromise

  • HTTP requests to Liferay endpoints containing redirect=// or FORWARD_URL=// parameter values
  • URL-encoded variants such as redirect=%2F%2F or redirect=/%2f in web server access logs
  • Referrer logs showing Liferay-hosted pages immediately preceding navigation to unrelated external domains

Detection Strategies

  • Parse Liferay web server and reverse proxy logs for any query parameter whose value begins with // or its encoded equivalents after any parameter that drives redirection
  • Alert on outbound redirects from Liferay portal responses (HTTP 302/303) whose Location header points to a host outside the organization's approved domain list
  • Correlate phishing report submissions with Liferay portal URLs containing a redirect or FORWARD_URL parameter

Monitoring Recommendations

  • Enable verbose access logging on all Liferay front-end web servers and capture full query strings
  • Baseline the normal set of external hosts referenced by redirect parameters and flag deviations
  • Monitor user reports of unexpected login prompts following clicks on Liferay links shared via email or chat

How to Mitigate CVE-2024-25609

Immediate Actions Required

  • Upgrade Liferay DXP to 7.4 update 9 or later, apply 7.3 service pack 3 fixes, or move to 7.2 fix pack 19 or later per the vendor advisory
  • Upgrade Liferay Portal to a release that supersedes 7.4.3.12 and incorporates the corrected HtmlUtil.escapeRedirect logic
  • Inventory any custom portlets and modules that invoke HtmlUtil.escapeRedirect and confirm they are rebuilt against the patched platform

Patch Information

Liferay has published fixes referenced in the Liferay CVE-2024-25609 advisory. The corrected implementation normalizes leading slashes before validating the redirect target, closing the bypass introduced by the incomplete CVE-2022-28977 fix.

Workarounds

  • Deploy a web application firewall rule that rejects requests where redirect, FORWARD_URL, or related parameters begin with //, /\, %2f%2f, or similar encoded prefixes
  • Enforce an allowlist of permitted redirect destinations at the reverse proxy and block any Location header that resolves outside the Liferay deployment
  • Educate end users about phishing links that originate on legitimate Liferay domains and require careful inspection of the final destination
bash
# Example WAF rule fragment (ModSecurity) blocking scheme-relative redirect bypasses
SecRule ARGS:redirect|ARGS:FORWARD_URL "@rx ^(/{2,}|\\{2,}|%2[fF]%2[fF]|%5[cC]%5[cC])" \
  "id:1002025,phase:2,deny,status:400,msg:'CVE-2024-25609 Liferay open redirect bypass attempt'"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.