GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GHSA-qpgq-5g92-j5q8medium6.1

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

Check your stack

The advisory, in context

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.

<img width="1548" height="638" alt="image" src="https://github.com/user-attachments/assets/64c18279-ec0a-4110-b8f4-d952870e348c" />

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)

<img width="1554" height="852" alt="image" src="https://github.com/user-attachments/assets/d8530247-2d2f-4747-bf16-ece71a507b50" />

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.

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Ecosystem versions

Earlier releases before 20.18.0

Fixed in 20.18.0

91 explicitly affected versions

1.9.1.1, 1.9.2.0, 1.9.2.1, 1.9.2.2, 1.9.2.3, 1.9.2.4, 1.9.3.0, 1.9.3.1, v19.4.0, v19.4.1, v19.4.10, v19.4.11, v19.4.12, v19.4.13, v19.4.14, v19.4.15, v19.4.16, v19.4.17, v19.4.18, v19.4.19, v19.4.2, v19.4.20, v19.4.21, v19.4.22, v19.4.23, v19.4.3, v19.4.4, v19.4.5, v19.4.6, v19.4.7, v19.4.8, v19.4.9, v19.5.0, v19.5.0-rc1, v19.5.0-rc2, v19.5.0-rc3, v19.5.0-rc4, v19.5.0-rc5, v19.5.1, v19.5.2, v19.5.3, v20.0.0, v20.0.1, v20.0.10, v20.0.11, v20.0.12, v20.0.13, v20.0.14, v20.0.15, v20.0.16, v20.0.17, v20.0.18, v20.0.19, v20.0.2, v20.0.20, v20.0.3, v20.0.4, v20.0.5, v20.0.6, v20.0.7, v20.0.8, v20.1.0, v20.1.0-rc1, v20.1.0-rc2, v20.1.0-rc3, v20.1.0-rc4, v20.1.0-rc5, v20.1.0-rc6, v20.1.0-rc7, v20.1.1, v20.10.0, v20.10.1, v20.10.2, v20.11.0, v20.12.0, v20.12.1, v20.12.2, v20.12.3, v20.13.0, v20.14.0, v20.15.0, v20.16.0, v20.17.0, v20.2.0, v20.3.0, v20.4.0, v20.5.0, v20.6.0, v20.7.0, v20.8.0, v20.9.0

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "20.18.0"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "1.9.1.1",
    "1.9.2.0",
    "1.9.2.1",
    "1.9.2.2",
    "1.9.2.3",
    "1.9.2.4",
    "1.9.3.0",
    "1.9.3.1",
    "v19.4.0",
    "v19.4.1",
    "v19.4.10",
    "v19.4.11",
    "v19.4.12",
    "v19.4.13",
    "v19.4.14",
    "v19.4.15",
    "v19.4.16",
    "v19.4.17",
    "v19.4.18",
    "v19.4.19",
    "v19.4.2",
    "v19.4.20",
    "v19.4.21",
    "v19.4.22",
    "v19.4.23",
    "v19.4.3",
    "v19.4.4",
    "v19.4.5",
    "v19.4.6",
    "v19.4.7",
    "v19.4.8",
    "v19.4.9",
    "v19.5.0",
    "v19.5.0-rc1",
    "v19.5.0-rc2",
    "v19.5.0-rc3",
    "v19.5.0-rc4",
    "v19.5.0-rc5",
    "v19.5.1",
    "v19.5.2",
    "v19.5.3",
    "v20.0.0",
    "v20.0.1",
    "v20.0.10",
    "v20.0.11",
    "v20.0.12",
    "v20.0.13",
    "v20.0.14",
    "v20.0.15",
    "v20.0.16",
    "v20.0.17",
    "v20.0.18",
    "v20.0.19",
    "v20.0.2",
    "v20.0.20",
    "v20.0.3",
    "v20.0.4",
    "v20.0.5",
    "v20.0.6",
    "v20.0.7",
    "v20.0.8",
    "v20.1.0",
    "v20.1.0-rc1",
    "v20.1.0-rc2",
    "v20.1.0-rc3",
    "v20.1.0-rc4",
    "v20.1.0-rc5",
    "v20.1.0-rc6",
    "v20.1.0-rc7",
    "v20.1.1",
    "v20.10.0",
    "v20.10.1",
    "v20.10.2",
    "v20.11.0",
    "v20.12.0",
    "v20.12.1",
    "v20.12.2",
    "v20.12.3",
    "v20.13.0",
    "v20.14.0",
    "v20.15.0",
    "v20.16.0",
    "v20.17.0",
    "v20.2.0",
    "v20.3.0",
    "v20.4.0",
    "v20.5.0",
    "v20.6.0",
    "v20.7.0",
    "v20.8.0",
    "v20.9.0"
  ]
}

References