Skip to main content
Public proof of conceptFix available

CVE-2022-36078

A public proof of concept exists; no exploitation attested.

  • Published2022-09-02
  • Fixed in0.7.1
  • WeaknessCWE-1284 · CWE-789

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2022-09-0213:15CVE publishedNVD

Versions per branch

NVD · OSV
Binary project binary
BranchAffectedFixed in
0.7< 0.7.10.7.1

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • gagliardetto binary
    Affected
    • = < 0.7.1no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2022-09-02

Fix

  1. Update Binary project binary to 0.7.1

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • CISA-ADPSSVC decisionpoc2025-04-22
  • CNACVSS 3.18.8known since 2026-10-23
  • NVDCVSS 3.17.5read 2026-10-23
  • CNAweakness (CWE)CWE-789known since 2026-10-23
  • NVDweakness (CWE)CWE-1284read 2026-10-23
  • FIRST EPSSEPSS score1.2 %2026-11-18
  • OSVaffected packages—
  • GitHub AdvisoriesadvisoryHIGH2022-09-16

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Published
2022-09-02
Last Modified
2026-06-17
NVD status
Modified
GitHub Advisory
GHSA-4p6f-m4f9-ch88

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.

Is CVE-2022-36078 actively exploited?

A proof-of-concept exploit exists for CVE-2022-36078, but active exploitation has not been confirmed at this time.

What is the CVSS score for CVE-2022-36078?

CVE-2022-36078 has a CVSS v3 base score of 7.5 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.

Running gagliardetto/binary? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record