Slice Memory Allocation with Excessive Size Value in binary
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-789.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| gagliardetto | binary | before 0.7.1 | 0.7.1 | Patch available | CNA |
| — | github.com/gagliardetto/binary (Go) | before 0.7.1 | 0.7.1 | Patch available | GHSA-4p6f-m4f9-ch88 |
- binary Vendorgagliardetto Affected before 0.7.1 Fixed in 0.7.1 Patch available CNA
- github.com/gagliardetto/binary (Go) Vendor— Affected before 0.7.1 Fixed in 0.7.1 Patch available GHSA-4p6f-m4f9-ch88
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:binary_project:binary:*:*:*:*:*:go:*:* | before 0.7.1 | Vulnerable | Binary Project |
- cpe:2.3:a:binary_project:binary:*:*:*:*:*:go:*:* Versions before 0.7.1 Vulnerable ·Binary Project
Remediation
- Fix · CNA binary (gagliardetto) Fixed in 0.7.1
- Fix · GHSA-4p6f-m4f9-ch88 github.com/gagliardetto/binary (Go) Fixed in 0.7.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-36078
- 2026-10-03 Alias added: GHSA-4p6f-m4f9-ch88
References
Advisory 2
Sources
- CVE-2022-36078 · CVE Program
- CVE-2022-36078 · NVD
- FIRST EPSS
- GHSA-4p6f-m4f9-ch88 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences