{"cve":"CVE-2025-65947","nvd":{"published":"2025-11-21T23:15:45.373","modified":"2026-10-18T20:10:00.110","status":"Deferred","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.","cvss_v4":{"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","score":8.7},"cvss_v3":null,"cwes":["CWE-400","CWE-772"],"references":["https://github.com/jzeuzs/thread-amount/commit/28860d4a38286609cb884c13b5b7941edc2390e5","https://github.com/jzeuzs/thread-amount/pull/29","https://github.com/jzeuzs/thread-amount/security/advisories/GHSA-jf9p-2fv9-2jp2"],"products":[],"source":"nvd","synced_at":"2026-10-19T22:16:02.354564667+00:00"},"epss":{"cve":"CVE-2025-65947","score":0.00371,"percentile":0.30812,"date":"2026-10-26"},"kev":null,"osv":[{"id":"GHSA-jf9p-2fv9-2jp2","url":"https://osv.dev/vulnerability/GHSA-jf9p-2fv9-2jp2","summary":"thread-amount Vulnerable to Resource Exhaustion (Memory and Handle Leaks) on Windows and macOS","modified":"2025-11-27T08:16:21.759428Z","packages":[{"ecosystem":"crates.io","name":"thread-amount","purl":"pkg:cargo/thread-amount","ranges":["<0.2.2"],"fixed":["0.2.2"]}]},{"id":"RUSTSEC-2025-0125","url":"https://osv.dev/vulnerability/RUSTSEC-2025-0125","summary":"Resource Exhaustion (Memory and Handle Leaks) on Windows and macOS","modified":"2025-11-22T12:29:36Z","packages":[{"ecosystem":"crates.io","name":"thread-amount","purl":"pkg:cargo/thread-amount","ranges":[">=0.0.0-0 <0.2.2"],"fixed":["0.2.2"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}