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-2021-28861

CVE-2021-28861: Python Open Redirection Vulnerability

CVE-2021-28861 is an open redirection flaw in Python 3.x through 3.10's http.server.py that may lead to information disclosure. This article covers the technical details, affected versions, and mitigation strategies.

Updated: May 16, 2026

CVE-2021-28861 Overview

CVE-2021-28861 is an open redirect vulnerability in Python 3.x through 3.10 affecting the lib/http/server.py module. The flaw stems from missing validation of multiple leading slashes (/) in the URI path. An attacker can craft a URL that causes http.server to redirect users to an attacker-controlled host, enabling phishing and information disclosure attacks. The issue is classified under CWE-601: URL Redirection to Untrusted Site. The vulnerability is disputed by a third party because Python documentation explicitly states that http.server is not recommended for production use and only implements basic security checks.

Critical Impact

Attackers can craft URIs with multiple leading slashes to redirect victims from a trusted Python http.server instance to malicious external domains, facilitating credential theft and phishing campaigns.

Affected Products

  • Python 3.x through 3.10 (including 3.11.0 alpha 1–7 and beta 1–3)
  • Fedora 35, 36, and 37
  • Debian and Gentoo distributions shipping affected Python versions

Discovery Timeline

  • 2022-08-23 - CVE-2021-28861 published to NVD
  • 2025-12-17 - Last updated in NVD database

Technical Details for CVE-2021-28861

Vulnerability Analysis

The vulnerability resides in the request handling logic of Python's built-in http.server module, specifically in lib/http/server.py. When the server receives a request with a path beginning with two or more forward slashes (for example, //evil.com/path), the redirect-handling code treats the path as a protocol-relative URL. Browsers interpret protocol-relative URLs by appending the current scheme, causing the user agent to navigate to evil.com instead of remaining on the original host.

The weakness is categorized as CWE-601, URL Redirection to Untrusted Site. Exploitation requires user interaction, as the victim must click a crafted link. The scope is changed because the redirect crosses a trust boundary from the Python server to an arbitrary external domain.

Root Cause

The root cause is insufficient input sanitization in the path normalization routine of http.server. The code did not collapse or reject sequences of leading slashes before constructing the Location header used in 301 Moved Permanently responses. The fix, applied in GitHub PR #93879, normalizes paths so that multiple leading slashes cannot be interpreted as a network-location authority component.

Attack Vector

The attack is delivered over the network and requires no privileges. An attacker constructs a URL such as http://victim-server/​//attacker.com/path and lures a user to click it. The vulnerable http.server instance responds with a redirect whose Location header points to the attacker domain. The browser follows the redirect, and the user lands on the malicious site while believing the link originated from the trusted server. Refer to Python Issue #43223 for the original technical discussion.

// No verified exploit code is published. See the linked Python bug tracker and pull requests for the patch diff and reproduction details.

Detection Methods for CVE-2021-28861

Indicators of Compromise

  • HTTP access logs from Python http.server containing request paths with two or more consecutive leading forward slashes (for example, GET //attacker.com/ HTTP/1.1)
  • Outbound 301 or 302 responses with Location headers pointing to external domains not controlled by the server operator
  • Referer headers in downstream web traffic showing redirection chains that originate from internal Python http.server endpoints

Detection Strategies

  • Inspect web server and reverse-proxy logs for URI patterns matching the regular expression ^/{2,}[^/] against any Python http.server host
  • Deploy web application firewall (WAF) rules that block or alert on requests whose path component begins with multiple slashes followed by a domain-like token
  • Correlate redirect responses with destination hostnames using DNS and threat-intelligence feeds to flag redirects to newly registered or low-reputation domains

Monitoring Recommendations

  • Forward Python http.server access logs to a centralized SIEM and build a dashboard that surfaces non-2xx responses with external Location headers
  • Alert on any production system still running http.server directly, since Python documentation warns it is not intended for production deployment
  • Monitor for spikes in user-clickthrough traffic from email gateways that resolve to internal Python service URLs containing encoded slashes (%2F%2F)

How to Mitigate CVE-2021-28861

Immediate Actions Required

  • Upgrade Python to a patched release that includes the fix from GitHub PR #93879
  • Replace any production use of http.server with a hardened WSGI or ASGI server such as gunicorn, uWSGI, or uvicorn fronted by a reverse proxy
  • Apply distribution-level updates for Fedora, Debian, and Gentoo as noted in the Gentoo GLSA #202305-02 and Debian LTS Announcement

Patch Information

The fix is tracked in the CPython repository through GitHub PR #24848 and GitHub PR #93879, which normalize paths containing multiple leading slashes before generating redirect responses. The patched code is included in Python 3.11 and backported to supported maintenance branches. Vendors including Fedora, Debian, and Gentoo have shipped updated packages; refer to the corresponding Fedora Package Announcement advisories.

Workarounds

  • Place a reverse proxy such as nginx or Apache in front of any exposed Python http.server instance and configure it to reject or normalize paths containing multiple leading slashes
  • Subclass http.server.SimpleHTTPRequestHandler and override the redirect logic to strip or reject paths matching ^/{2,}
  • Restrict http.server to loopback interfaces (127.0.0.1) so external clients cannot reach the vulnerable endpoint
bash
# nginx snippet to reject requests with multiple leading slashes before they reach the Python backend
location / {
    if ($request_uri ~ "^//") {
        return 400;
    }
    proxy_pass http://127.0.0.1:8000;
}

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

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechPython

  • SeverityHIGH

  • CVSS Score7.4

  • EPSS Probability1.40%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-601
  • Technical References
  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA #202305-02

  • Debian LTS Announcement

  • Debian LTS Announcement

  • Lists Debian
  • Vendor Resources
  • Python Issue #43223

  • GitHub PR #24848

  • GitHub PR #93879
  • Related CVEs
  • CVE-2026-2297: CPython Information Disclosure Vulnerability

  • CVE-2025-12781: Python base64 Module Data Integrity Flaw

  • CVE-2024-4032: Python ipaddress Module Info Disclosure

  • CVE-2023-40217: Python TLS Information Disclosure Flaw
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