{"answers":{"affected":"3 open source packages ship an affected version, including github.com/gagliardetto/binary. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36078 exists.","fix":"Upgrade github.com/gagliardetto/binary to 0.7.1 or later.","what":"CVE-2022-36078 is a high-severity denial of service vulnerability in gagliardetto binary, published on 2 Sep 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-36078 and fix it if it is affected.\n\nWhat it is: CVE-2022-36078 is a high-severity denial of service vulnerability in gagliardetto binary, published on 2 Sep 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36078 exists.\n\nAffected packages and fixed versions:\n- github.com/gagliardetto/binary (Go): affected all versions; fixed in 0.7.1\n- github.com/gagliardetto/binary (Go): affected all versions; fixed in 0.7.1\n- github.com/gagliardetto/binary (Go): affected all versions; fixed in 0.7.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-36078/ (Markdown: https://insights.sbomify.com/CVE-2022-36078/index.md)","id":"CVE-2022-36078","markdown":"https://insights.sbomify.com/CVE-2022-36078/index.md","name":"CVE-2022-36078","record":{"aliases":["GHSA-4p6f-m4f9-ch88","GO-2022-0963"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Go binary encoding library","requires_auth":"none","summary":"Attackers can cause denial of service by triggering excessive memory allocation when parsing untrusted data with the binary library.","user_interaction":"required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"binary","vendor":"binary_project"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-1284","name":"Improper Validation of Specified Quantity in Input"},{"id":"CWE-789","name":"Memory Allocation with Excessive Size Value"}],"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(\u0026val)` 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(\u0026val)` function to parse the data, but to use a custom `UnmarshalWithDecoder()` method that reads and checks the length of any slice.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Slice Memory Allocation with Excessive Size Value in binary","id":"CVE-2022-36078","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"denial_of_service","year":"2022"},"n_packages":3,"n_references":3,"next":{"headline":"Parse Server vulnerable to brute force guessing of user sensitive data via search patterns","id":"CVE-2022-36079"},"packages":[{"ecosystem":"Go","fixed":["0.7.1"],"introduced":["0"],"last_affected":[],"package":"github.com/gagliardetto/binary","purl":null,"source":"GHSA-4p6f-m4f9-ch88"},{"ecosystem":"Go","fixed":["0.7.1"],"introduced":["0"],"last_affected":[],"package":"github.com/gagliardetto/binary","purl":"pkg:golang/github.com/gagliardetto/binary","source":"GHSA-4p6f-m4f9-ch88"},{"ecosystem":"Go","fixed":["0.7.1"],"introduced":["0"],"last_affected":[],"package":"github.com/gagliardetto/binary","purl":"pkg:golang/github.com/gagliardetto/binary","source":"GO-2022-0963"}],"prev":{"headline":"Electron subject to Exfiltration of hashed SMB credentials on Windows via file:// redirect","id":"CVE-2022-36077"},"products":["binary"],"published":"2022-09-02","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["gagliardetto"]},"summary":"Attackers can cause denial of service by triggering excessive memory allocation when parsing untrusted data with the binary library.","url":"https://insights.sbomify.com/CVE-2022-36078/"}