RUSTSEC-2026-0156

Source
https://rustsec.org/advisories/RUSTSEC-2026-0156
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0156.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0156
Published
2026-06-01T12:00:00Z
Modified
2026-06-03T10:45:04.175671146Z
Summary
Bad-free in `MetaCallException::new`
Details

exception_struct is a local stack variable, but the code passes its address to the C language as &mut exception_struct as *mut _ as *mut c_void. Then, the returned MetaCallException value is stored here:

Ok(Self {
    exception_struct: Arc::new(exception_struct),
    value: exception_ptr,
    leak: false,
})

Because leak is false, the destructor will run later. But the original exception pointer points to Rust stack memory.

Trigger

#[test]
fn exception_bad_free_safe_api() {
    let original = metacall::MetaCallException::new(
        "test",
        "test",
        "test",
        1,
    );

    drop(original); // AddressSanitizer: bad-free
}

Impact

Every time the MetaCallException is created, when it is dropped, it leads to a bad-free. This can be triggered through the safe public API MetaCallException::new(), with no unsafe required from the caller.

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

Affected packages

crates.io / metacall

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0

Ecosystem specific

{
    "affects": {
        "arch": [],
        "functions": [],
        "os": []
    },
    "affected_functions": null
}

Database specific

categories
[
    "memory-corruption"
]
cvss
null
informational
null
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0156.json"