Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2026-2240

CVE-2026-2240: janet-lang Use After Free Vulnerability

CVE-2026-2240 is a use after free vulnerability in janet-lang janet up to version 1.40.1 affecting janetc_pop_funcdef function. This article covers the technical details, affected versions, security impact, and mitigation.

Published: February 13, 2026

CVE-2026-2240 Overview

A vulnerability has been discovered in janet-lang Janet up to version 1.40.1 that allows an out-of-bounds read in the compiler component. The impacted element is the function janetc_pop_funcdef located in the file src/core/compile.c. This memory corruption vulnerability requires local access to exploit and has been publicly disclosed with a proof-of-concept available.

Critical Impact

Local attackers can trigger an out-of-bounds read condition in the Janet compiler, potentially leading to information disclosure or application crashes when processing maliciously crafted Janet code.

Affected Products

  • janet-lang Janet versions up to and including 1.40.1
  • Applications embedding the Janet runtime/compiler
  • Systems running Janet-based scripts with untrusted input

Discovery Timeline

  • February 9, 2026 - CVE-2026-2240 published to NVD
  • February 9, 2026 - Last updated in NVD database

Technical Details for CVE-2026-2240

Vulnerability Analysis

This vulnerability exists in the Janet programming language's compiler implementation, specifically within the janetc_pop_funcdef function in src/core/compile.c. The flaw is classified as CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer), manifesting as an out-of-bounds read condition.

The root cause involves insufficient bounds checking when accessing the closure bitset chunks array. The compiler's register allocator preallocates certain registers in the high 16 bits of chunk index 7 (registers 240-255), but the original code failed to verify that the slotchunks count was large enough before attempting to mask those bits.

Root Cause

The vulnerability stems from a missing bounds check in the closure bitset handling logic. The original code checked if scope->ua.count > 7 before accessing chunks[7], but failed to also verify that slotchunks > 7. This allowed the code to potentially access chunks[7] when the slotchunks allocation was insufficient, resulting in an out-of-bounds memory read.

Attack Vector

An attacker with local access must craft a malicious Janet source file that triggers the vulnerable code path during compilation. When the Janet compiler processes this input, it can read memory beyond the allocated buffer bounds. While this vulnerability requires local access and has limited direct security impact, it could potentially be chained with other vulnerabilities or used to crash Janet-based applications processing untrusted code.

c
// Security patch in src/core/compile.c
// Source: https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5

            JANET_OUT_OF_MEMORY;
        }
        memcpy(chunks, scope->ua.chunks, sizeof(uint32_t) * numchunks);
+        /* fprintf(stderr, "slot chunks: %d, scope->ua.count: %d, numchunks: %d\n", slotchunks, scope->ua.count, numchunks); */
        /* Register allocator preallocates some registers [240-255, high 16 bits of chunk index 7], we can ignore those. */
-        if (scope->ua.count > 7) chunks[7] &= 0xFFFFU;
+        if (scope->ua.count > 7 && slotchunks > 7) chunks[7] &= 0xFFFFU;
        def->closure_bitset = chunks;
    }

The patch adds an additional bounds check (slotchunks > 7) to ensure the chunks array is large enough before accessing index 7.

Detection Methods for CVE-2026-2240

Indicators of Compromise

  • Unexpected crashes in Janet compiler or Janet-based applications
  • Segmentation faults or memory access violations during Janet code compilation
  • Error logs indicating memory corruption in compile.c or related components
  • Anomalous memory read patterns in processes running Janet

Detection Strategies

  • Monitor for application crashes with stack traces involving janetc_pop_funcdef function
  • Implement memory sanitizers (AddressSanitizer) during development and testing to catch out-of-bounds reads
  • Review system logs for Janet process crashes or unexpected terminations
  • Use static analysis tools to identify potential memory safety issues in Janet integrations

Monitoring Recommendations

  • Deploy endpoint detection and response (EDR) solutions to monitor for abnormal process behavior
  • Implement file integrity monitoring on Janet source files and compiled outputs
  • Set up alerting for repeated crashes in Janet-based services
  • Monitor process memory usage patterns for anomalies that may indicate exploitation attempts

How to Mitigate CVE-2026-2240

Immediate Actions Required

  • Update janet-lang Janet to a version containing commit 4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5 or later
  • Review applications that embed Janet for exposure to untrusted input
  • Implement input validation for Janet source code before compilation
  • Consider sandboxing Janet compilation processes that handle untrusted input

Patch Information

A security patch has been released by the Janet maintainers. The fix is available in commit 4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5. Additional details can be found in GitHub Issue #1702.

Workarounds

  • Restrict Janet compilation to trusted source files only until patching is complete
  • Run Janet processes with reduced privileges to limit impact of potential exploitation
  • Use process isolation or containerization for Janet-based applications handling external input
  • Implement resource limits and monitoring on Janet compiler processes
bash
# Verify Janet version and check for vulnerability
janet -v

# Build Janet from source with the security patch applied
git clone https://github.com/janet-lang/janet.git
cd janet
git checkout 4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5
make clean && make
sudo make install

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

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechJanet Lang

  • SeverityMEDIUM

  • CVSS Score4.8

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-119
  • Technical References
  • GitHub Repository for Janet

  • GitHub Commit 4dd08a4c

  • GitHub Issue #1702

  • GitHub Issue Comment #1702

  • GitHub Repro Repository

  • VulDB CTI ID #344979

  • VulDB ID #344979

  • VulDB Submission #753155
  • Related CVEs
  • CVE-2026-2241: janet-lang janet Buffer Overflow Vulnerability

  • CVE-2026-2242: janet-lang Buffer Overflow Vulnerability
Default Legacy - Prefooter | 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