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-2024-28397

CVE-2024-28397: js2py RCE Vulnerability

CVE-2024-28397 is a remote code execution vulnerability in js2py up to v0.74 that allows attackers to execute arbitrary code via crafted API calls. This article covers the technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2024-28397 Overview

CVE-2024-28397 is a code injection vulnerability affecting the js2py Python library, a JavaScript to Python translator and JavaScript interpreter written in pure Python. The vulnerability exists in the js2py.disable_pyimport() function, which is designed to create a sandbox environment by disabling Python imports from within JavaScript code. However, attackers can bypass this security mechanism through a crafted API call, enabling arbitrary code execution within the Python environment.

Critical Impact

Attackers can escape the js2py sandbox environment and execute arbitrary Python code, potentially leading to complete system compromise in applications that rely on js2py for safe JavaScript execution.

Affected Products

  • js2py versions up to v0.74
  • Applications using js2py for JavaScript sandboxing
  • Python environments utilizing js2py with disable_pyimport() protection

Discovery Timeline

  • 2024-06-20 - CVE-2024-28397 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-28397

Vulnerability Analysis

This vulnerability represents a sandbox escape flaw (CWE-94: Improper Control of Generation of Code) in the js2py library. The js2py library provides a disable_pyimport() function that is intended to prevent JavaScript code from accessing Python's import system, thereby creating a sandboxed execution environment. However, the implementation of this security control is flawed, allowing attackers to craft specific API calls that bypass the import restrictions.

When exploited, this vulnerability allows malicious JavaScript code executed through js2py to access Python's native functionality, including the ability to import arbitrary modules and execute system commands. This effectively nullifies the security guarantees that applications expect from the sandboxing mechanism.

Root Cause

The root cause of this vulnerability lies in the incomplete implementation of the sandbox isolation in js2py.disable_pyimport(). The function fails to adequately block all pathways through which JavaScript code can access Python's internal mechanisms. Specifically, certain object traversal techniques and prototype manipulation within the JavaScript context can be leveraged to reach Python objects that were intended to be restricted.

Attack Vector

The attack requires local access to an application that uses js2py with the disable_pyimport() sandbox. An attacker must be able to supply JavaScript code to the js2py interpreter, which is then executed in what the application believes is a sandboxed environment. Through careful crafting of JavaScript code that manipulates object prototypes and traverses the internal object hierarchy, the attacker can escape the sandbox and gain access to Python's import system.

Once the sandbox is escaped, the attacker can import arbitrary Python modules such as os or subprocess, enabling command execution on the underlying system with the privileges of the Python process.

The exploitation technique involves manipulating JavaScript objects to access Python's internal structures that remain accessible despite the disable_pyimport() call. Technical details and a proof-of-concept demonstrating this sandbox escape are available in the CVE-2024-28397 PoC repository.

Detection Methods for CVE-2024-28397

Indicators of Compromise

  • Unexpected Python module imports occurring within js2py execution contexts
  • System command execution originating from Python processes running js2py
  • Unusual object traversal patterns in JavaScript code submitted to js2py interpreters
  • Evidence of sandbox escape attempts in application logs

Detection Strategies

  • Monitor applications using js2py for unexpected system calls or subprocess creation
  • Implement logging around js2py execution to capture JavaScript code patterns associated with sandbox escapes
  • Use runtime application self-protection (RASP) to detect attempts to access restricted Python objects
  • Deploy SentinelOne Singularity to detect anomalous process behavior from Python applications

Monitoring Recommendations

  • Enable verbose logging for applications utilizing js2py to capture execution details
  • Monitor for process spawning from Python processes that utilize js2py
  • Implement network monitoring for unexpected outbound connections from affected applications
  • Use file integrity monitoring on systems running vulnerable js2py versions

How to Mitigate CVE-2024-28397

Immediate Actions Required

  • Audit all applications to identify usage of js2py library versions up to v0.74
  • Evaluate whether the disable_pyimport() function is being relied upon for security boundaries
  • Consider removing js2py from production environments where sandboxing is a security requirement
  • Implement additional application-level controls to restrict JavaScript input to trusted sources only

Patch Information

As of the last update to this CVE, no official patch has been released that addresses this sandbox escape vulnerability. The js2py library has not received updates to remediate this issue. Organizations should evaluate alternative JavaScript execution solutions that provide stronger isolation guarantees.

For the latest information on patches and security updates, monitor the js2py GitHub repository and the CVE-2024-28397 PoC repository for community developments.

Workarounds

  • Replace js2py with alternative JavaScript execution libraries that provide stronger sandboxing, such as PyMiniRacer or containerized execution environments
  • Implement process-level isolation using containers or separate processes with restricted permissions when executing untrusted JavaScript
  • Apply strict input validation to reject JavaScript code that contains suspicious patterns associated with sandbox escapes
  • Run js2py in a minimal privilege environment to limit the impact of successful exploitation
bash
# Example: Running js2py application in a restricted container
# Create a restricted Docker container for js2py execution
docker run --rm \
  --read-only \
  --no-new-privileges \
  --security-opt=no-new-privileges:true \
  --cap-drop=ALL \
  -u nobody:nogroup \
  your-js2py-application

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechJs2py

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability69.13%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-94
  • Technical References
  • GitHub User Profile

  • GitHub CVE-2024-28397 PoC
  • 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