CVE-2024-21909: PeterO.Cbor Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-6r92-cgxc-r5fg
CWE-407
Published
Advisory Summary

CVE-2024-21909 is a HIGH denial of service vulnerability (CWE-407: Inefficient Algorithmic Complexity) affecting PeterO.Cbor libraries in the NuGet ecosystem. The issue involves denial of service in cbor library. Remediation is available by upgrading affected packages to version 4.5.1.

CVE-2024-21909 at a Glance

CVE Identifier CVE-2024-21909
GHSA Identifier GHSA-6r92-cgxc-r5fg
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-407: Inefficient Algorithmic Complexity
Affected Product PeterO.Cbor
Package Ecosystem NuGet
Published Date
Last Updated

How to Fix CVE-2024-21909

To remediate this vulnerability, upgrade all affected PeterO.Cbor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

PeterO.Cbor fixed: 4.5.1
Upgrade PeterO.Cbor to 4.5.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for PeterO.Cbor

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-21909, inspect your project dependencies for PeterO.Cbor:

inspect dependencies for PeterO.Cbor

Analyze the terminal output to locate any version of PeterO.Cbor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-407: Inefficient Algorithmic Complexity, where an algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. In PeterO.Cbor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Due to this library's use of an inefficient algorithm, it is vulnerable to a denial of service attack when a maliciously crafted input is passed to `DecodeFromBytes` or other CBOR decoding mechanisms in this library. Affected versions _include_ versions 4.0.0 through 4.5.0. This vulnerability was privately reported to me. ### Patches This issue has been fixed in version 4.5.1. Users should use the latest version of this library. (The latest version is not necessarily 4.5.1. Check the [NuGet page](https://www.nuget.org/packages/PeterO.Cbor) to see the latest version's version number.) ### Workarounds Again, users should use the latest version of this library. In the meantime, note that the inputs affected by this issue are all CBOR maps or contain CBOR maps. An input that decodes to a single CBOR object is not capable of containing a CBOR map if— - it begins with a byte other than 0x80 through 0xDF, or - it does not contain a byte in the range 0xa0 through 0xBF. Such an input is not affected by this vulnerability and an application can choose to perform this check before passing it to a CBOR decoding mechanism. ### For more information If you have any questions or comments about this advisory: * Open an issue in [the CBOR repository](https://github.com/peteroupc/CBOR).

CVE-2024-21909 Affected PeterO.Cbor Versions

1 component(s)
Fixed Versions:
4.5.1
Product / Package Ecosystem Affected Versions Fixed Version
PeterO.Cbor
NuGet
≥ 4.0.0
< 4.5.1
4.5.1

References

Frequently Asked Questions

What is CVE-2024-21909?
CVE-2024-21909 is a security vulnerability in PeterO.Cbor involving Denial of service in CBOR library under CWE-407: Inefficient Algorithmic Complexity.
Which PeterO.Cbor versions are affected?
Affected versions include releases prior to 4.5.1 across affected packages: PeterO.Cbor.
What version fixes CVE-2024-21909?
Upgrading to 4.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is PeterO.Cbor affected?
Yes, PeterO.Cbor is affected in releases prior to 4.5.1. Upgrade your dependency to 4.5.1 or later.
What CWE is associated with CVE-2024-21909?
CVE-2024-21909 is classified under CWE-407: Inefficient Algorithmic Complexity (An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.).
How can I check NuGet dependencies for CVE-2024-21909?
Run the dependency tree command: 'inspect dependencies for PeterO.Cbor'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6r92-cgxc-r5fg",
  "modified" : "2024-01-03T22:29:30Z",
  "published" : "2022-01-21T23:35:35Z",
  "aliases" : [ "CVE-2024-21909" ],
  "summary" : "Denial of service in CBOR library",
  "details" : "### Impact\nDue to this library's use of an inefficient algorithm, it is vulnerable to a denial of service attack when a maliciously crafted input is passed to `DecodeFromBytes` or other CBOR decoding mechanisms in this library.\n\nAffected versions _include_ versions 4.0.0 through 4.5.0.\n\nThis vulnerability was privately reported to me.\n\n### Patches\nThis issue has been fixed in version 4.5.1.  Users should use the latest version of this library. (The latest version is not necessarily 4.5.1.  Check the [NuGet page](https://www.nuget.org/packages/PeterO.Cbor) to see the latest version's version number.)\n\n### Workarounds\n\nAgain, users should use the latest version of this library.\n\nIn the meantime, note that the inputs affected by this issue are all CBOR maps or contain CBOR maps.  An input that decodes to a single CBOR object is not capable of containing a CBOR map if&mdash;\n\n- it begins with a byte other than 0x80 through 0xDF, or\n- it does not contain a byte in the range 0xa0 through 0xBF.\n\nSuch an input is not affected by this vulnerability and an application can choose to perform this check before passing it to a CBOR decoding mechanism.\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).\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "PeterO.Cbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/peteroupc/CBOR/security/advisories/GHSA-6r92-cgxc-r5fg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/peteroupc/CBOR/commit/b4117dbbb4cd5a4a963f9d0c9aa132f033e15b95"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/peteroupc/CBOR"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/peteroupc/CBOR/compare/v4.5...v4.5.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-407" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-18T22:57:46Z",
    "nvd_published_at" : null
  }
}