The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2025-22153

CVE-2025-22153: RestrictedPython Auth Bypass Vulnerability

CVE-2025-22153 is an authentication bypass flaw in RestrictedPython caused by a type confusion bug in CPython 3.11-3.13.1. Attackers can bypass security restrictions using try/except* clauses. This article covers technical details, affected versions, impact, and mitigation.

Updated: January 22, 2026

CVE-2025-22153 Overview

CVE-2025-22153 is a type confusion vulnerability in RestrictedPython, a security tool designed to define a safe subset of the Python language for use in trusted execution environments. This vulnerability allows attackers to bypass the RestrictedPython sandbox by exploiting a type confusion bug in CPython's try/except* exception handling mechanism.

RestrictedPython is commonly used in applications that need to execute untrusted Python code safely, such as content management systems, plugin frameworks, and multi-tenant platforms. The sandbox escape capability of this vulnerability undermines the fundamental security guarantees that RestrictedPython provides, potentially allowing malicious code to escape containment and execute arbitrary operations in the host environment.

Critical Impact

Attackers can bypass RestrictedPython's sandbox restrictions through a type confusion bug in CPython 3.11+ when using try/except* clauses, potentially gaining unrestricted code execution in trusted environments.

Affected Products

  • RestrictedPython versions 6.0 through 7.x (prior to version 8.0)
  • CPython versions 3.11 through 3.13.1 (prior to 3.13.2)
  • Applications using RestrictedPython for sandboxed Python code execution

Discovery Timeline

  • 2025-01-23 - CVE-2025-22153 published to NVD
  • 2025-01-23 - Last updated in NVD database

Technical Details for CVE-2025-22153

Vulnerability Analysis

This vulnerability stems from a type confusion bug (CWE-843) in the CPython interpreter's implementation of the try/except* syntax, which was introduced in Python 3.11 as part of PEP 654 for handling exception groups. RestrictedPython added support for this feature in version 6.0, inadvertently creating an attack vector that allows sandbox escape.

The type confusion occurs during exception handling in the try/except* construct, where the interpreter incorrectly handles object types in a way that can be exploited to circumvent RestrictedPython's access controls. This allows an attacker to craft malicious code that appears compliant with RestrictedPython's restrictions but can break out of the sandbox when executed.

The attack requires network access and elevated privileges, with high complexity due to the specific conditions needed to trigger the type confusion. However, successful exploitation can have severe consequences, including unauthorized access to protected resources and arbitrary code execution outside the sandbox boundary.

Root Cause

The root cause is a type confusion vulnerability in CPython's exception group handling mechanism. When RestrictedPython version 6.0 added support for try/except* clauses to maintain compatibility with Python 3.11+, it inherited this underlying interpreter bug. The RestrictedPython security checks do not adequately handle the type confusion scenario, allowing specially crafted exception handling code to bypass the sandbox's restrictions.

Attack Vector

The attack vector is network-based, requiring the attacker to submit malicious Python code to an application that uses RestrictedPython for sandboxed execution. The attacker must craft code that:

  1. Utilizes the try/except* syntax introduced in Python 3.11
  2. Triggers the type confusion condition in the CPython interpreter
  3. Leverages the confused type state to escape RestrictedPython's access controls

The exploitation chain requires elevated privileges within the target application context and has high attack complexity due to the precise conditions required to trigger the vulnerability.

text
 Changes
 =======
 
-7.5 (unreleased)
+8.0 (unreleased)
 ----------------
 
+Backwards incompatible changes
+++++++++++++++++++++++++++++++
+
+- Disallow ``try/except*`` clauses due to a possible sandbox escape and
+  probable uselessness of this feature in the context of ``RestrictedPython``.
+  In addition, remove ``ExceptionGroup`` from ``safe_builtins`` (as useful only
+  with ``try/except*``). - This feature was introduced into
+  ``RestrictedPython`` in version 6.0 for Python 3.11+. (CVE-2025-22153)
+
 - Drop support for Python 3.8.
 
+Features
+++++++++
+
 - Update setuptools version pin.
   (`#292 <https://github.com/zopefoundation/RestrictedPython/issues/292>`_)

Source: GitHub Commit

Detection Methods for CVE-2025-22153

Indicators of Compromise

  • Presence of try/except* syntax in submitted or executed Python code within RestrictedPython sandboxes
  • Unexpected access to system resources or protected builtins from sandboxed code execution
  • Anomalous exception handling patterns involving ExceptionGroup objects in application logs
  • Evidence of code execution outside expected sandbox boundaries

Detection Strategies

  • Monitor RestrictedPython execution logs for code containing try/except* patterns
  • Implement static analysis scanning of submitted Python code for exception group syntax before execution
  • Deploy runtime monitoring to detect sandbox escape attempts or unauthorized resource access
  • Use SentinelOne's behavioral AI to identify anomalous code execution patterns indicating sandbox bypass

Monitoring Recommendations

  • Enable detailed logging for all RestrictedPython code compilation and execution events
  • Alert on any use of ExceptionGroup or try/except* syntax in sandboxed environments
  • Monitor for process behavior anomalies that may indicate successful sandbox escape
  • Track network connections and file system access from processes running sandboxed code

How to Mitigate CVE-2025-22153

Immediate Actions Required

  • Upgrade RestrictedPython to version 8.0 or later immediately
  • Audit all deployed applications using RestrictedPython for affected versions
  • If immediate upgrade is not possible, consider temporarily disabling sandboxed code execution features
  • Review application logs for any suspicious code submissions containing try/except* patterns

Patch Information

The RestrictedPython maintainers have addressed this vulnerability in version 8.0 by completely removing support for try/except* clauses and removing ExceptionGroup from the safe_builtins collection. The patch commit 48a92c5bb617a647cffd0dadd4d5cfe626bcdb2f implements these changes.

For detailed patch information, refer to the GitHub Security Advisory and the patch commit.

Workarounds

  • No known workarounds are available according to the vendor advisory
  • The only recommended mitigation is upgrading to RestrictedPython version 8.0 or later
  • Organizations unable to upgrade should consider temporarily suspending features that execute untrusted Python code
bash
# Upgrade RestrictedPython to the patched version
pip install --upgrade RestrictedPython>=8.0

# Verify installed version
pip show RestrictedPython | grep Version

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

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechRestrictedpython

  • SeverityHIGH

  • CVSS Score7.9

  • EPSS Probability0.16%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:L
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-843
  • Technical References
  • GitHub Commit Update

  • GitHub Security Advisory
  • Latest CVEs
  • CVE-2026-35467: Browser API Key Information Disclosure

  • CVE-2026-35466: cveInterface.js XSS Vulnerability

  • CVE-2026-30252: ZenShare Suite XSS Vulnerability

  • CVE-2026-30251: ZenShare Suite v17.0 XSS Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now 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