binary: Improper Validation of Specified Quantity in Input
CVE-2022-36078 is a high-severity improper validation of specified quantity in input vulnerability in binary from Gagliardetto, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected binary versions: < 0.7.1. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.21% chance of exploitation within 30 days, higher than 69% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of binary you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Gagliardetto | binary | < 0.7.1 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- NoneNo data is disclosed.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.8 | High | CNA (github.com) |
| CVSS 3.1 | 7.5 | High | NVD |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Validation of Specified Quantity in Input
The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.
More Improper Validation of Specified Quantity in Input vulnerabilities (CWE-1284)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/gagliardetto/binary/security/advisories/GHSA-4p6f-m4f9-ch88Exploit, Mitigation, Third Party Advisory
Patches and release notes
- github.com/gagliardetto/binary/pull/7Issue Tracking, Third Party Advisory
- github.com/gagliardetto/binary/releases/tag/v0.7.1Release Notes, Third Party Advisory
Recent Improper Validation of Specified Quantity in Input vulnerabilities
- 7.5 High severity
- 9.8 Critical severity
- 7.8 High severity
- 7.8 High severity
- 8.1 High severity
- 7.5 High severity
Spotted an error? Tell us.