Skip to content

Vulnerability Report - Redirect handling depends on vulnerable Express redirect logic #379

Description

@trilokdhaked

Vulnerability name : Redirect handling depends on vulnerable Express redirect logic

Severity: Medium

Affected locations:

  • package.json:34
  • src/getRouter.js:87-89

Description

The SDK forwards addon-provided redirect targets directly into res.redirect(307, resp.redirect). The pinned express@4.16.3 release is affected by published advisories for:

  • XSS via response.redirect()
  • Open redirect in malformed URLs

The sink is reachable whenever an addon handler returns a redirect value. In practice, exploitability depends on whether addon code derives that value from untrusted upstream or user-controlled input. This means the issue is conditional, but still security-relevant: the SDK ships a known-vulnerable redirect implementation and exposes it as part of its response handling path.

Steps to reproduce

  1. Clone the repository and run npm install.
  2. Run npm audit --json --omit=dev.
  3. Confirm that express@4.16.3 is flagged for:
    • GHSA-qw6h-vgh9-j6wx
    • GHSA-rv95-896h-c2vc
  4. Create an addon handler that returns a redirect derived from external input.
  5. Request the affected route and verify that the SDK passes the value unchanged to res.redirect().
  6. Validate behavior with the vendor advisory test cases for the affected Express version.

Proof of concept

Reachable sink in the SDK:

if (resp.redirect) {
  res.redirect(307, resp.redirect)
  return
}

Locally reported advisories:

express vulnerable to XSS via response.redirect()
https://github.com/advisories/GHSA-qw6h-vgh9-j6wx

Express.js Open Redirect in malformed URLs
https://github.com/advisories/GHSA-rv95-896h-c2vc

Security impact

  • Open redirect if addons pass attacker-controlled redirect targets
  • Client-side script execution risk in redirect-related browser flows on affected Express versions
  • Phishing and trust-abuse opportunities if redirect values are sourced from untrusted inputs

impact

  • Brand and trust damage from phishing-style redirects
  • Support and incident handling costs
  • Potential abuse of partner or affiliate traffic flows

Remediation

  • Upgrade express to >=4.21.2 or a newer supported release after compatibility testing
  • Treat resp.redirect as untrusted data and validate scheme, host, and normalization before redirecting
  • Prefer an allowlist of redirect destinations where possible
  • Reject malformed or non-HTTP(S) redirect targets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions