Skip to content

Magento LTS Vulnerable to Open Redirect via Unvalidated `uenc` Parameter in `stockAction()`

Moderate severity GitHub Reviewed Published May 4, 2026 in OpenMage/magento-lts • Updated May 5, 2026

Package

composer openmage/magento-lts (Composer)

Affected versions

<= 20.17.0

Patched versions

20.18.0

Description

Summary

Mage_ProductAlert_AddController::stockAction() reads the uenc query parameter and passes it directly to $this->_redirectUrl($backUrl) without calling $this->_isUrlInternal() When the supplied product_id does not match any catalog product, the server issues an unvalidated HTTP 302 redirect to whatever URL was provided as uenc.

Vulnerable path:

// app/code/core/Mage/ProductAlert/controllers/AddController.php : stockAction()

$backUrl = $this->getRequest()->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED);  // raw, no decode
$productId = (int) $this->getRequest()->getParam('product_id');

if (!$backUrl || !$productId) {
    $this->_redirect('/');
    return;
}

$product = Mage::getModel('catalog/product')->load($productId);

if (!$product->getId()) {
    $session->addError($this->__('Not enough parameters.'));
    $this->_redirectUrl($backUrl);   // ← NO _isUrlInternal() check
    return;
}

Secure peer (priceAction()):

if (!$product->getId()) {
    if ($this->_isUrlInternal($backUrl)) {  // ← validation present
        $this->_redirectUrl($backUrl);
    } else {
        $this->_redirect('/');
    }
    return;
}

Steps to Reproduce

Prerequisites

  • OpenMage LTS ≤ 20.16.0 with Product Alerts enabled (default configuration)
  • A valid, logged-in customer session on the target store

Step 1 – Authenticate as a Customer (Attacker controls the crafted link; victim must be logged in)

The preDispatch() hook calls Mage::getSingleton('customer/session')->authenticate($this). If the request comes from an unauthenticated user, they are redirected to the login page first. The open redirect only fires after the customer is authenticated. This is the realistic attack scenario: the attacker sends a crafted link to a customer who is already logged in.

image

Step 2 – Craft the Malicious URL

The uenc parameter is read raw via getParam() with no base64 decoding in this code path. A plain URL is sufficient and produces the redirect:

GET /productalert/add/stock/?product_id=99999&uenc=https://evil.com/steal-credentials HTTP/1.1
Host: <store-hostname>
Cookie: om_frontend=<authenticated-session>

Key conditions:

  • product_id must reference a non-existent product (triggers the vulnerable branch; any large ID works)
  • uenc is the raw destination URL (no base64 encoding required)

image

Impact

Technical Impact

An attacker who controls the uenc parameter value can redirect any logged-in shopper to an arbitrary external URL. Because the redirect originates from the legitimate store domain, the victim’s browser shows the trusted store URL in the address bar momentarily before being sent to the attacker site. The HTTP 302 response exits the store’s origin before the browser shows anything to the user.

Business-Level Attack Vectors

Scenario Description
Credential phishing Craft a link claiming to show a stock notification. Customer lands on attacker’s login clone and reuses their password.
OAuth / SSO token theft If the store uses a social login or “Login with Google” flow, the attacker can inject their redirect_uri via the open redirect, stealing OAuth tokens.
Affiliate fraud Redirect customers from the legitimate store to a competing retailer after they click a “notify me” link.
Malware distribution Redirect to drive-by-download pages with the store’s reputation acting as social proof.

Propagation

A single malicious link can be embedded in:

  • Customer emails (“Click here for stock notification preferences”)
  • Forum posts, social media, or product reviews on the store
  • SEO-poisoned search results that rank the store’s domain

Recommended Fix

Apply the same _isUrlInternal() guard used in priceAction() to the stockAction() missing-product

This is an AI-generated report.

An attempt was made to test the same PoC against the online demo https://demo.openmage.org/ but it couldn't be reproduced. It was only reproduced against the local setup env against the latest version.

References

@sreichel sreichel published to OpenMage/magento-lts May 4, 2026
Published to the GitHub Advisory Database May 5, 2026
Reviewed May 5, 2026
Last updated May 5, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

EPSS score

Weaknesses

URL Redirection to Untrusted Site ('Open Redirect')

The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. Learn more on MITRE.

CVE ID

CVE-2026-42207

GHSA ID

GHSA-qpgq-5g92-j5q8

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.