CVE-2025-65947: thread-amount Package Vulnerable to Resource Exhaustion on Windows and macOS

thread-amount Updated 14 Dec 2025

Summary

21/11/2025
Yes i
High
8.7

CVE-2025-65947: thread-amount Vulnerable to Resource Exhaustion (Memory and Handle Leaks) on Windows and macOS. Affects thread-amount versions < 0.2.2. Fixed in 0.2.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The thread-amount package is a Rust crate designed to provide a simple and efficient way to query the number of threads in a process. It is commonly used in applications that require monitoring of system resources, such as servers and daemons. However, this package has been found to have vulnerabilities that can lead to resource exhaustion, particularly on Windows and macOS platforms.

Vulnerability Detail

The vulnerability arises from improper resource management in the thread_amount function. On Windows, the function calls CreateToolhelp32Snapshot but fails to close the returned HANDLE, leading to a handle leak. On macOS, the function calls task_threads, which allocates memory for the thread list but does not deallocate it, resulting in a memory leak. These leaks can cause long-running applications to crash due to system instability or memory exhaustion.

How To Fix

Minimum fixed version

0.2.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid calling the thread_amount function repeatedly in a short time frame to minimize the impact of resource leaks. Implementing a caching mechanism to store thread counts for a period can help reduce the frequency of calls.

Conclusion

The thread-amount package has a significant vulnerability that can lead to resource exhaustion on Windows and macOS platforms. It is crucial for developers using this package to update to the latest version to mitigate risks associated with this issue. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for thread-amount →

Share this vulnerability

FAQ

The vulnerability affects applications running on Windows and macOS platforms.

Failure to address this vulnerability can lead to resource exhaustion, causing applications to crash or become unstable over time.

You can use Vulert, a tool that monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without any signup.

Yes, a patch is available in version 0.2.2 of the thread-amount package. Updating to this version will resolve the vulnerability.

If immediate updates are not possible, consider implementing a caching mechanism to reduce the frequency of calls to the thread_amount function as a temporary workaround.

How To Fix

Minimum fixed version

0.2.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback