{"answers":{"affected":"2 open source packages ship an affected version, including PeterO.Cbor.","exploited":"There is no known exploitation of GHSA-cxw4-9qv9-vx5h in the wild and no public exploit code.","fix":"Upgrade PeterO.Cbor to 4.0.0 or later.","what":"GHSA-cxw4-9qv9-vx5h is a denial of service vulnerability in PeterO.Cbor, published on 30 Sep 2019. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-cxw4-9qv9-vx5h and fix it if it is affected.\n\nWhat it is: GHSA-cxw4-9qv9-vx5h is a denial of service vulnerability in PeterO.Cbor, published on 30 Sep 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-cxw4-9qv9-vx5h in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- PeterO.Cbor (NuGet): affected all versions; fixed in 4.0.0\n- PeterO.Cbor (NuGet): affected all versions; fixed in 4.0.0\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/GHSA-cxw4-9qv9-vx5h/ (Markdown: https://insights.sbomify.com/GHSA-cxw4-9qv9-vx5h/index.md)","id":"GHSA-cxw4-9qv9-vx5h","markdown":"https://insights.sbomify.com/GHSA-cxw4-9qv9-vx5h/index.md","name":"GHSA-cxw4-9qv9-vx5h","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"CBOR library","requires_auth":"none","summary":"Attackers can cause denial of service by sending deeply nested CBOR objects that expand excessively during serialization, affecting applications using the PeterO.Cbor library.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\nThe CBOR library supports optional tags that enable CBOR objects to contain references to objects within them. Versions earlier than 4.0 resolved those references automatically. While this by itself doesn't cause much of a security problem, a denial of service can happen if those references are deeply nested and used multiple times (so that the same reference to the same object occurs multiple times), and if the decoded CBOR object is sent to a serialization method such as `EncodeToBytes`, `ToString`, or `ToJSONString`, since the objects referred to are expanded in the process and take up orders of magnitude more memory than if the references weren't resolved.\n\nThe impact of this problem on any particular system varies.  In general, the risk is higher if the system allows users to send arbitrary CBOR objects without authentication, or exposes a remote endpoint in which arbitrary CBOR objects can be sent without authentication.\n\n### Patches\nThis problem is addressed in version 4.0 by disabling reference resolution by default.  Users should use the latest version of this library.\n\n### Workarounds\nSince version 3.6, an encoding option (`resolvereferences=true` or `resolvereferences=false`) in CBOREncodeOptions sets whether the CBOR processor will resolve these kinds of references when decoding a CBOR object.  Set `resolvereferences=false` to disable reference resolution.\n\nIn version 3.6, if the method used `CBORObject.Read()` or `CBORObject.DecodeFromBytes()` to decode a serialized CBOR object, call the overload that takes `CBOREncodeOptions` as follows:\n\n    CBORObject.DecodeFromBytes(bytes, new CBOREncodeOptions(\"resolvereferences=false\"));\n\nIn versions 3.5 and earlier, this issue is present only if the CBOR object is an array or a map.  If the application does not expect a decoded CBOR object to be an array or a map, it should check the CBOR object's type before encoding that object, as follows:\n\n    if (cbor.Type != CBORType.Array \u0026\u0026 cbor.Type != CBORType.Map) {\n       cbor.EncodeToBytes();\n    }\n\nAlternatively, for such versions, the application can use `WriteTo` to decode the CBOR object to a so-called \"limited memory stream\", that is, a `Stream` that throws an exception if too many bytes would be written.  How to write such a limited-memory stream is nontrivial and beyond the scope of this advisory.\n\n    using(var stream = new LimitedMemoryStream(100000)) { // Limit to 100000 bytes\n         cbor.WriteTo(stream);\n         return stream.ToBytes();\n    }\n\nTo check whether a byte array representing a CBOR object might exhibit this problem, check whether the array contains the byte 0xd8 followed immediately by either 0x19 or 0x1d.  This check catches all affected CBOR objects but may catch some non-affected CBOR objects (notably integers and byte strings).\n\n### References\n\nSee the Wikipedia article [Billion laughs attack](https://en.wikipedia.org/wiki/Billion_laughs_attack) and the related issue in [Kubernetes](https://github.com/kubernetes/kubernetes/issues/83253).\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the CBOR repository](https://github.com/peteroupc/CBOR).","ecosystems":["NuGet"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"High severity vulnerability that affects PeterO.Cbor","id":"GHSA-cxw4-9qv9-vx5h","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"NuGet","product":null,"products":[],"type":"denial_of_service","year":"2019"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"NuGet","fixed":["4.0.0"],"introduced":["0"],"last_affected":[],"package":"PeterO.Cbor","purl":null,"source":"GHSA-cxw4-9qv9-vx5h"},{"ecosystem":"NuGet","fixed":["4.0.0"],"introduced":["0"],"last_affected":[],"package":"PeterO.Cbor","purl":"pkg:nuget/PeterO.Cbor","source":"GHSA-cxw4-9qv9-vx5h"}],"products":null,"published":"2019-09-30","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can cause denial of service by sending deeply nested CBOR objects that expand excessively during serialization, affecting applications using the PeterO.Cbor library.","url":"https://insights.sbomify.com/GHSA-cxw4-9qv9-vx5h/"}