Skip to content

Commit f656b5f

Browse files
1 parent d135bdc commit f656b5f

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-jf9p-2fv9-2jp2",
4+
"modified": "2025-11-21T18:19:40Z",
5+
"published": "2025-11-21T18:19:40Z",
6+
"aliases": [],
7+
"summary": "thread-amount Vulnerable to Resource Exhaustion (Memory and Handle Leaks) on Windows and macOS",
8+
"details": "Affected versions of this crate contain resource leaks when querying thread counts on Windows and Apple platforms.\n\n### Windows\nThe `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.\n\n### macOS / iOS\nThe `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.\n\n### Impact\nLong-running applications (such as servers, daemons, or monitoring tools) that use this crate to periodically check thread counts will eventually crash due to resource exhaustion.\n\n### Resources\n- https://github.com/jzeuzs/thread-amount/pull/29",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "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"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "crates.io",
19+
"name": "thread-amount"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.2.2"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/jzeuzs/thread-amount/security/advisories/GHSA-jf9p-2fv9-2jp2"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/jzeuzs/thread-amount/pull/29"
44+
},
45+
{
46+
"type": "PACKAGE",
47+
"url": "https://github.com/jzeuzs/thread-amount"
48+
}
49+
],
50+
"database_specific": {
51+
"cwe_ids": [
52+
"CWE-400",
53+
"CWE-772"
54+
],
55+
"severity": "HIGH",
56+
"github_reviewed": true,
57+
"github_reviewed_at": "2025-11-21T18:19:40Z",
58+
"nvd_published_at": null
59+
}
60+
}

0 commit comments

Comments
 (0)