A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-29041

CVE-2024-29041: Express.js Open Redirect Vulnerability

CVE-2024-29041 is an open redirect vulnerability in Express.js that allows attackers to bypass URL allow lists using malformed URLs. This article covers the technical details, affected versions, and mitigation steps.

Published: January 28, 2026

CVE-2024-29041 Overview

CVE-2024-29041 is an open redirect vulnerability affecting Express.js, the popular minimalist web framework for Node.js. Versions prior to 4.19.0 and all pre-release alpha and beta versions of 5.0 are vulnerable to open redirect attacks through the use of malformed URLs. The vulnerability allows attackers to bypass properly implemented redirect allow lists in Express applications, potentially redirecting users to malicious external sites.

When Express.js performs a redirect using a user-provided URL, it encodes the contents using encodeurl before passing it to the location header. This encoding behavior can cause malformed URLs to be evaluated in unexpected ways by common redirect allow list implementations, enabling attackers to circumvent security controls designed to restrict redirect destinations.

Critical Impact

Attackers can exploit this vulnerability to redirect users from legitimate Express.js applications to malicious websites, enabling phishing attacks, credential theft, and malware distribution by abusing the trust users place in the original application domain.

Affected Products

  • Express.js versions prior to 4.19.0
  • Express.js 5.0.0-alpha1 through 5.0.0-alpha8
  • Express.js 5.0.0-beta1 and 5.0.0-beta2

Discovery Timeline

  • 2024-03-25 - CVE-2024-29041 published to NVD
  • 2025-12-18 - Last updated in NVD database

Technical Details for CVE-2024-29041

Vulnerability Analysis

This open redirect vulnerability (CWE-601) stems from how Express.js handles URL encoding in redirect operations. The primary methods affected are res.location() and res.redirect(), which are commonly used to direct users to different endpoints. The vulnerability requires user interaction, as victims must click on a crafted link for the attack to succeed. The scope change characteristic means a successful exploit can impact resources beyond the vulnerable component, affecting the user's browser security context.

The attack exploits a mismatch between how Express encodes URLs and how application-level allow list validations interpret those URLs. Malformed URLs that pass initial allow list checks may redirect to unintended destinations after Express applies its encoding, effectively bypassing security controls that developers believe are protecting their applications.

Root Cause

The root cause lies in the interaction between Express.js's URL encoding mechanism and typical allow list validation patterns. When res.location() or res.redirect() is called with a user-provided URL, Express passes the URL through encodeurl before setting the location header. This encoding step occurs after any application-level allow list validation, creating a window where malformed URLs can transform into valid redirect destinations that were not permitted by the original security checks.

Attack Vector

The attack vector is network-based, requiring an attacker to craft a specially malformed URL that:

  1. Passes the application's redirect allow list validation in its original form
  2. After encoding by Express.js, resolves to an attacker-controlled destination

This attack requires user interaction—the victim must be tricked into clicking a link containing the malicious redirect URL. Common attack scenarios include phishing emails or malicious links that appear to point to the legitimate application but ultimately redirect users to attacker-controlled sites.

The following code shows the security patches applied to lib/response.js:

Initial patch approach:

javascript
 var mime = send.mime;
 var resolve = path.resolve;
 var vary = require('vary');
+var urlParse = require('url').parse;
 
 /**
  * Response prototype.

Source: GitHub Commit Update

Improved fix (final patch):

javascript
 var mime = send.mime;
 var resolve = path.resolve;
 var vary = require('vary');
-var urlParse = require('url').parse;
 
 /**
  * Response prototype.

Source: GitHub Commit Change

The patches address the URL parsing and encoding behavior to ensure consistent handling of redirect URLs, preventing the encoding from creating unexpected redirect destinations.

Detection Methods for CVE-2024-29041

Indicators of Compromise

  • HTTP responses with Location headers containing encoded special characters that differ from the original request URL
  • Redirect responses (HTTP 301, 302, 303, 307, 308) to external domains when only internal redirects should be permitted
  • Web server logs showing redirect requests with malformed or unusual URL patterns in query parameters
  • User reports of being redirected to unexpected or suspicious websites after clicking legitimate-looking links

Detection Strategies

  • Implement application logging for all res.redirect() and res.location() calls, capturing both input URLs and final encoded values
  • Deploy Web Application Firewall (WAF) rules to detect and block requests containing malformed URL patterns commonly used in open redirect attacks
  • Use Software Composition Analysis (SCA) tools to identify Express.js dependencies running vulnerable versions
  • Monitor for anomalous redirect patterns in web traffic analytics that may indicate exploitation attempts

Monitoring Recommendations

  • Enable detailed logging for HTTP redirect responses and monitor for redirects to external domains
  • Set up alerts for requests containing URL-encoded characters or unusual URL schemes in redirect parameters
  • Implement Content Security Policy (CSP) with strict redirect controls and monitor violation reports
  • Regularly audit application dependencies using npm audit or similar tools to identify vulnerable Express.js versions

How to Mitigate CVE-2024-29041

Immediate Actions Required

  • Update Express.js to version 4.19.2 or later for the 4.x branch
  • Update Express.js to version 5.0.0-beta.3 or later for applications using the 5.x pre-release versions
  • Review all usages of res.redirect() and res.location() in your application code
  • Implement server-side validation of redirect destinations that occurs after URL encoding

Patch Information

The vulnerability has been fixed in Express.js versions 4.19.2 and 5.0.0-beta.3. The security patches are available through the official npm registry. Organizations should update their package.json files to require the patched versions and run npm update express to apply the fix. Detailed information about the fix is available in the GitHub Security Advisory.

Workarounds

  • Implement strict URL validation that parses and reconstructs redirect URLs before passing them to Express redirect functions
  • Use absolute URLs with explicit protocol and domain checks rather than relying on relative redirects
  • Implement a strict allowlist of permitted redirect destinations using exact URL matching rather than pattern-based validation
  • Consider using middleware that validates redirect URLs after encoding to catch potential bypasses
bash
# Configuration example - Update Express.js to patched version
npm update express@4.19.2

# Or specify in package.json
# "express": ">=4.19.2"

# Verify installed version
npm list express

# Run security audit to check for vulnerabilities
npm audit

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeOther

  • Vendor/TechOpenjsf Express

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability0.11%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-601
  • Technical References
  • Express API Documentation

  • GitHub Pull Request Discussion

  • Koa Issue Discussion
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Commit Change

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2024-10491: OpenJSF Express Injection Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English