# CVE-2025-65947: thread-amount is Vulnerable to Resource Exhaustion (Memory and Handle Leaks) on Windows and macOS

- Severity: High 8.7 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.37%, higher than 33% of CVEs (2026-12-01)
- Published: 2025-11-21T18:19:40.000Z
- Modified: 2026-10-18T20:10:00.110Z
- Also known as: GHSA-jf9p-2fv9-2jp2, RUSTSEC-2025-0125
- Weaknesses: CWE-400, CWE-772
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

thread-amount is a tool that gets the amount of threads in the current process. Prior to version 0.2.2, there are resource leaks when querying thread counts on Windows and Apple platforms. In Windows platforms, the thread_amount function calls CreateToolhelp32Snapshot but fails to close the returned HANDLE using CloseHandle. Repeated calls to this function will cause the handle count of the process to grow indefinitely, eventually leading to system instability or process termination when the handle limit is reached. In Apple platforms, the thread_amount function calls task_threads (via Mach kernel APIs) which allocates memory for the thread list. The function fails to deallocate this memory using vm_deallocate. Repeated calls will result in a steady memory leak, eventually causing the process to be killed by the OOM (Out of Memory) killer. This issue has been patched in version 0.2.2.

(As written by CVE List.)

## Affected

- jzeuzs thread-amount: < 0.2.2
- thread-amount (crates.io): before 0.2.2; from 0.0.0-0 before 0.2.2

## Every score

- GitHub_M: CVSS:4.0 8.7 High `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`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `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`
- RustSec Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/jzeuzs/thread-amount/security/advisories/GHSA-jf9p-2fv9-2jp2> (web)
- <https://github.com/jzeuzs/thread-amount/pull/29> (web)
- <https://github.com/jzeuzs/thread-amount/commit/28860d4a38286609cb884c13b5b7941edc2390e5> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-65947> (advisory)
- <https://github.com/jzeuzs/thread-amount> (package)
- <https://rustsec.org/advisories/RUSTSEC-2025-0125.html> (advisory, web)
- <https://crates.io/crates/thread-amount> (package)

## Sources

- CVE List: [CVE-2025-65947](https://www.cve.org/CVERecord?id=CVE-2025-65947), CVE Terms of Use, modified 2025-11-24
- GitHub Advisory Database: [GHSA-jf9p-2fv9-2jp2](https://github.com/advisories/GHSA-jf9p-2fv9-2jp2), CC-BY-4.0, modified 2025-11-27
- RustSec Advisory Database: [RUSTSEC-2025-0125](https://rustsec.org/advisories/RUSTSEC-2025-0125.html), CC0-1.0, modified 2025-11-22
- NVD: [CVE-2025-65947](https://nvd.nist.gov/vuln/detail/CVE-2025-65947), Public domain, modified 2026-10-18

---

Page: https://cve.day/CVE-2025-65947 · Whole record: https://cve.day/CVE-2025-65947.json · Rebuilt by cve.day 2026-11-25T22:59:07.934Z
