CVE-2022-36078
CVE-2022-36078 is a high-severity vulnerability in Binary Project Binary with a CVSS 3.x base score of 8.8. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-1284.
Key facts
- Severity: High (CVSS 3.x base score 8.8)
- EPSS exploit prediction: 1% (57th percentile)
- Actively exploited: Not listed in CISA KEV
- Weakness: CWE-1284
- Affected product: Binary Project Binary
- Published:
- Last modified:
Description
Binary provides encoding/decoding in Borsh and other formats. The vulnerability is a memory allocation vulnerability that can be exploited to allocate slices in memory with (arbitrary) excessive size value, which can either exhaust available memory or crash the whole program. When using `github.com/gagliardetto/binary` to parse unchecked (or wrong type of) data from untrusted sources of input (e.g. the blockchain) into slices, it's possible to allocate memory with excessive size. When `dec.Decode(&val)` method is used to parse data into a structure that is or contains slices of values, the length of the slice was previously read directly from the data itself without any checks on the size of it, and then a slice was allocated. This could lead to an overflow and an allocation of memory with excessive size value. Users should upgrade to `v0.7.1` or higher. A workaround is not to rely on the `dec.Decode(&val)` function to parse the data, but to use a custom `UnmarshalWithDecoder()` method that reads and checks the length of any slice.
Frequently asked questions
- What is CVE-2022-36078?
- Binary provides encoding/decoding in Borsh and other formats. The vulnerability is a memory allocation vulnerability that can be exploited to allocate slices in memory with (arbitrary) excessive size value, which can either exhaust available memory or crash the whole program. When using `github.com/gagliardetto/binary` to parse unchecked (or wrong type of) data from untrusted sources of input (e.g. the blockchain) into slices, it's possible to allocate memory with excessive size. When `dec.Decode(&val)` method is used to parse data into a structure that is or contains slices of values, the length of the slice was previously read directly from the data itself without any checks on the size of it, and then a slice was allocated. This could lead to an overflow and an allocation of memory with excessive size value. Users should upgrade to `v0.7.1` or higher. A workaround is not to rely on the `dec.Decode(&val)` function to parse the data, but to use a custom `UnmarshalWithDecoder()` method that reads and checks the length of any slice.
- How severe is CVE-2022-36078?
- CVE-2022-36078 has a CVSS 3.x base score of 8.8, rated high severity. It is exploitable over network with low attack complexity, requires no privileges and user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2022-36078 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (57th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2022-36078?
- CVE-2022-36078 affects Binary Project Binary. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2022-36078?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- When was CVE-2022-36078 published?
- CVE-2022-36078 was published on 2022-09-02 and last updated on 2026-06-17.
References
- https://github.com/gagliardetto/binary/pull/7
- https://github.com/gagliardetto/binary/releases/tag/v0.7.1
- https://github.com/gagliardetto/binary/security/advisories/GHSA-4p6f-m4f9-ch88
Affected products (1)
- cpe:2.3:a:binary_project:binary:*:*:*:*:*:go:*:*
Other CWE-1284 (Improper Validation of Specified Quantity in Input) vulnerabilities
- CVE-2026-49777 — Critical (CVSS 10.0): Improper Validation of Specified Quantity in Input vulnerability in ShapedPlugin, LLC Product Slider Pro for…
- CVE-2024-8887 — Critical (CVSS 10.0): CIRCUTOR Q-SMT in its firmware version 1.0.4, could be affected by a denial of service (DoS) attack if an attacker with…
- CVE-2022-20699 — Critical (CVSS 10.0): Multiple vulnerabilities in Cisco Small Business RV160, RV260, RV340, and RV345 Series Routers could allow an attacker…
- CVE-2021-21960 — Critical (CVSS 10.0): A stack-based buffer overflow vulnerability exists in both the LLMNR functionality of Sealevel Systems, Inc. SeaConnect…
- CVE-2021-21951 — Critical (CVSS 10.0): An out-of-bounds write vulnerability exists in the CMD_DEVICE_GET_SERVER_LIST_REQUEST functionality of the…
- CVE-2021-21950 — Critical (CVSS 10.0): An out-of-bounds write vulnerability exists in the CMD_DEVICE_GET_SERVER_LIST_REQUEST functionality of the…
Browse all CWE-1284 (Improper Validation of Specified Quantity in Input) vulnerabilities →