RUSTSEC-2023-0033

Source
https://rustsec.org/advisories/RUSTSEC-2023-0033
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2023-0033.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2023-0033
Aliases
Published
2023-04-12T12:00:00Z
Modified
2024-09-23T15:02:17Z
Summary
Parsing borsh messages with ZST which are not-copy/clone is unsound
Details

Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) are parsed and the Copy/Clone traits are not implemented/derived. For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy (this can be achieved through a singleton), then accessing/writing to deserialized data will cause a segmentation fault.

There is currently no way for borsh to read data without also providing a Rust type. Therefore, if not ZST are used for serialization, then you are not affected by this issue.

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

Affected packages

crates.io / borsh

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.10.4
Introduced
0.11.0-0
Fixed
1.0.0-alpha.1

Ecosystem specific

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

Database specific

{
    "cvss": null,
    "informational": "unsound",
    "categories": [
        "memory-corruption"
    ]
}