Drupal Anonymous Open Redirect in drupal/drupal
Summary
GHSA-x6v2-xmrq-574j: Drupal Anonymous Open Redirect. Affects drupal/drupal across 2 version ranges.
>= 8.0.0, < 8.5.8
>= 8.6.0, < 8.6.2
Fixed in 8.5.8 or 8.6.2, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Drupal is a popular open-source content management system (CMS) written in PHP. It is widely used for building websites and web applications. The drupal/drupal package is the core package of Drupal that provides the fundamental functionality and features of the CMS. This vulnerability affects versions 8.0.0 to 8.5.8 and versions 8.6.0 to 8.6.2 of the drupal/drupal package. The vulnerability allows malicious users to construct URLs with a manipulated 'destination' query string parameter, leading to potential social engineering attacks.
Vulnerability Detail
The Drupal Anonymous Open Redirect vulnerability arises from the usage of the 'destination' query string parameter in URLs by Drupal core and contributed modules. This parameter is commonly used to redirect users to a new destination after completing an action on the current page. However, under certain circumstances, attackers can exploit this parameter to craft URLs that trick users into being redirected to a third-party website. This exposes users to potential social engineering attacks, where they may be deceived into divulging sensitive information or performing unintended actions.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 8.0.0, < 8.5.88.5.8composer require drupal/drupal:8.5.8 -
>= 8.6.0, < 8.6.28.6.2composer require drupal/drupal:8.6.2
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, developers can manually validate and sanitize the 'destination' query string parameter in their code. This can be done by checking the URL against a whitelist of allowed destinations or by using a regular expression to ensure the URL follows the expected format. Here is an example of how to sanitize the 'destination' parameter in PHP:
$destination = $_GET['destination'];
if (preg_match('/^/[a-zA-Z0-9/]+$/', $destination)) {
// Valid destination, proceed with redirection
header('Location: ' . $destination);
exit;
} else {
// Invalid destination, handle error
echo 'Invalid destination';
}
Conclusion
The Drupal Anonymous Open Redirect vulnerability in the drupal/drupal package allows attackers to manipulate the 'destination' query string parameter and redirect users to malicious websites. Upgrading to the latest version of the package is recommended to fix the vulnerability. In the meantime, developers can implement a temporary workaround by manually validating and sanitizing the 'destination' parameter in their code. For further assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for drupal/drupal →
FAQ
Drupal is an open-source content management system (CMS) written in PHP. It is used for building websites and web applications.
The drupal/drupal package is the core package of Drupal that provides the fundamental functionality and features of the CMS.
The 'destination' query string parameter is used in Drupal URLs to redirect users to a new destination after completing an action on the current page.
Attackers can exploit this vulnerability by manipulating the 'destination' query string parameter in URLs to trick users into being redirected to a third-party website.
The vulnerability exposes users to potential social engineering attacks, where they may be deceived into divulging sensitive information or performing unintended actions.
References
Related vulnerabilities
Recent vulnerabilities recorded for drupal/drupal.