CVE-2022-24794: URL Redirection to Untrusted Site in express-openid-connect

express-openid-connect Updated 02 Oct 2025

Summary

31/03/2022
Yes i
High
7.5

CVE-2022-24794: URL Redirection to Untrusted Site ('Open Redirect') in express-openid-connect. Affects express-openid-connect versions < 2.7.2. Fixed in 2.7.2. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

express-openid-connect is an npm package that provides OpenID Connect authentication and authorization middleware for Express.js applications. It allows developers to easily integrate OpenID Connect authentication into their Express.js applications. This vulnerability affects versions of express-openid-connect up to and including 2.7.1.

Vulnerability Detail

The vulnerability in express-openid-connect allows for URL redirection to an untrusted site, also known as an Open Redirect vulnerability. When the requiresAuth middleware is applied to a catch-all route, a user visiting a URL like http://example.com//google.com will be redirected to google.com after login. This occurs because the original URL reported by the Express framework is not properly sanitized. This vulnerability can be exploited if all routes under example.com are protected with the requiresAuth middleware.

How To Fix

Minimum fixed version

2.7.2

This is the first release that contains the fix.

npm install express-openid-connect@2.7.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to upgrade to the latest version of express-openid-connect to mitigate the risk.

Conclusion

The URL redirection vulnerability in express-openid-connect can be mitigated by upgrading to version 2.7.2 or later. It is important to promptly apply this update to prevent potential phishing attacks or unauthorized redirection of users to untrusted sites. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for express-openid-connect →

Share this vulnerability

FAQ

You are affected by this vulnerability if you are using the requiresAuth middleware on a catch-all route or the default authRequired option and express-openid-connect version <=2.7.1.

The impact of this vulnerability is that an attacker can craft a malicious URL that redirects users to an untrusted site after login. This can be used for phishing attacks or to trick users into visiting malicious websites.

To fix this vulnerability, you should upgrade to version >=2.7.2 of express-openid-connect. This update includes a patch that properly sanitizes the original URL to prevent URL redirection to untrusted sites.

No, the fix provided in the patch will not affect your users. It only addresses the URL redirection vulnerability and does not introduce any breaking changes.

Related vulnerabilities

Recent vulnerabilities recorded for express-openid-connect.

How To Fix

Minimum fixed version

2.7.2

This is the first release that contains the fix.

npm install express-openid-connect@2.7.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback