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
    • 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-2025-65947

CVE-2025-65947: thread-amount DOS Vulnerability

CVE-2025-65947 is a denial of service vulnerability in thread-amount caused by resource leaks on Windows and Apple platforms. This article covers the technical details, affected versions, and mitigation strategies.

Published: May 11, 2026

CVE-2025-65947 Overview

CVE-2025-65947 affects thread-amount, a small utility library that returns the number of threads in the current process. Versions prior to 0.2.2 contain resource leaks on Windows and Apple platforms. On Windows, the library leaks kernel handles from CreateToolhelp32Snapshot. On Apple platforms, it leaks memory allocated by the Mach task_threads API. Repeated invocations exhaust system resources, leading to process termination or system instability. The maintainer released a fix in version 0.2.2. The weakness is classified as Uncontrolled Resource Consumption [CWE-400].

Critical Impact

Long-running processes that invoke thread_amount in a loop will exhaust handles on Windows or be killed by the Out-of-Memory (OOM) killer on macOS, causing denial of service.

Affected Products

  • thread-amount versions prior to 0.2.2 on Windows platforms
  • thread-amount versions prior to 0.2.2 on Apple (macOS) platforms
  • Downstream applications and services that embed vulnerable versions of thread-amount

Discovery Timeline

  • 2025-11-21 - CVE-2025-65947 published to NVD
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-65947

Vulnerability Analysis

The thread-amount library exposes a thread_amount function that returns the count of threads in the current process. On both Windows and Apple platforms, the implementation acquires platform-specific resources to enumerate threads but never releases them. Each invocation accumulates state inside the process. Over time, the leaked resources push the process past operating system limits.

On Windows, every call increases the process handle count. Once the per-process handle limit is reached, subsequent Win32 calls fail and the process becomes unstable or terminates. On macOS, every call grows the resident memory footprint. The kernel eventually invokes the OOM killer, terminating the process. The weakness maps to Uncontrolled Resource Consumption [CWE-400].

Root Cause

On Windows, thread_amount calls CreateToolhelp32Snapshot to obtain a snapshot of running threads but never invokes CloseHandle on the returned HANDLE. The kernel object remains referenced for the lifetime of the process.

On Apple platforms, thread_amount calls the Mach kernel API task_threads, which allocates a thread port array in the caller's virtual address space. The function never calls vm_deallocate to release that allocation. Memory grows linearly with the number of calls.

Attack Vector

Exploitation does not require authentication or user interaction. Any code path that triggers repeated execution of thread_amount will trigger the leak. In server applications, network-reachable endpoints that call the function during request handling allow remote attackers to force resource exhaustion by issuing high-volume requests. The result is a denial-of-service condition against availability without affecting confidentiality or integrity.

See the GitHub Security Advisory GHSA-jf9p-2fv9-2jp2 for the maintainer's technical write-up.

Detection Methods for CVE-2025-65947

Indicators of Compromise

  • Monotonically increasing handle count for a Windows process linked against thread-amount versions below 0.2.2, observable via Task Manager, Process Explorer, or Get-Process | Select-Object Handles.
  • Steadily growing resident set size (RSS) on macOS processes using thread-amount, visible via top, vmmap, or ps -o rss.
  • Process crashes accompanied by ERROR_NO_SYSTEM_RESOURCES on Windows or Jetsam/OOM kill log entries on macOS.

Detection Strategies

  • Inventory build manifests (Cargo.toml, Cargo.lock) for direct or transitive dependencies on thread-amount below version 0.2.2.
  • Add performance counters or telemetry for process handle counts and memory growth in long-running services that consume the library.
  • Correlate availability incidents with deployment timelines to identify regressions tied to vulnerable releases.

Monitoring Recommendations

  • Configure alerts when a process handle count exceeds a baseline threshold or grows linearly over time.
  • Monitor macOS endpoints for repeated OOM terminations of the same binary.
  • Track software composition analysis (SCA) findings to flag any reintroduction of pre-0.2.2 releases.

How to Mitigate CVE-2025-65947

Immediate Actions Required

  • Upgrade thread-amount to version 0.2.2 or later in all dependent projects.
  • Rebuild and redeploy downstream binaries that statically link the library.
  • Restart long-running processes that have already accumulated leaked handles or memory.

Patch Information

The maintainer released the fix in version 0.2.2. The patch closes the Windows HANDLE returned by CreateToolhelp32Snapshot with CloseHandle and releases the Mach thread list with vm_deallocate after task_threads. Review the upstream changes in the GitHub Commit Update and the GitHub Pull Request.

Workarounds

  • Cache the thread count in application code and avoid calling thread_amount on hot paths until the patched version is deployed.
  • Replace the dependency with a direct, properly-closing call to CreateToolhelp32Snapshot/CloseHandle on Windows or task_threads/vm_deallocate on macOS.
  • Periodically recycle worker processes to bound resource consumption while patching is in progress.
bash
# Update the dependency in a Rust project
cargo update -p thread-amount --precise 0.2.2
cargo build --release

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechThread Amount

  • SeverityHIGH

  • CVSS Score8.7

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/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
  • AvailabilityHigh
  • CWE References
  • CWE-400
  • Technical References
  • GitHub Commit Update

  • GitHub Pull Request

  • GitHub Security Advisory GHSA-jf9p-2fv9-2jp2
  • Latest CVEs
  • CVE-2025-52479: HTTP.jl & URIs.jl CRLF Injection Flaw

  • CVE-2026-31740: Linux Kernel Race Condition Vulnerability

  • CVE-2026-31743: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31744: Linux Kernel NULL Pointer 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