RUSTSEC-2025-0125

Source
https://rustsec.org/advisories/RUSTSEC-2025-0125
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2025-0125.json
JSON Data
https://api.test.osv.dev/v1/vulns/RUSTSEC-2025-0125
Aliases
Published
2025-11-22T12:00:00Z
Modified
2025-11-22T12:34:28.665865Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Resource Exhaustion (Memory and Handle Leaks) on Windows and macOS
Details

Affected versions of this crate contain resource leaks when querying thread counts on Windows and Apple platforms.

Windows

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.

macOS / iOS

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.

Impact

Long-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.

Mitigation

Upgrade to version 0.2.2 or later, which properly releases OS resources.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / thread-amount

Package

Name
thread-amount
View open source insights on deps.dev
Purl
pkg:cargo/thread-amount

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.2.2

Ecosystem specific

{
    "affects": {
        "functions": [
            "thread_amount::is_single_threaded",
            "thread_amount::thread_amount"
        ],
        "os": [
            "windows",
            "macos",
            "ios"
        ],
        "arch": []
    },
    "affected_functions": null
}

Database specific

cvss

"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"

informational

null

categories

[
    "denial-of-service"
]