CVE-2022-29189: Github.com/pion/dtls Pion/DTLS Contains Buffer For Inbound Vulnerability

MODERATE
Advisory Identifier: GHSA-cx94-mrg9-rq4j
CVSS 5.3
CWE-120
Published
Advisory Summary

CVE-2022-29189 is a MODERATE (CVSS 5.3) pion/dtls contains buffer for inbound vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting Github.com/pion/dtls libraries in the Go ecosystem. The issue involves pion/dtls contains buffer for inbound dtls fragments with no limit. Remediation is available by upgrading affected packages to version 2.1.4.

CVE-2022-29189 at a Glance

CVE Identifier CVE-2022-29189
GHSA Identifier GHSA-cx94-mrg9-rq4j
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product Github.com/pion/dtls
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2022-29189

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

github.com/pion/dtls fixed: 2.1.4
Upgrade github.com/pion/dtls to 2.1.4
github.com/pion/dtls/v2 fixed: 2.1.4
Upgrade github.com/pion/dtls/v2 to 2.1.4
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 github.com/pion/dtls

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-29189, inspect your project dependencies for Github.com/pion/dtls:

inspect dependencies for github.com/pion/dtls

Analyze the terminal output to locate any version of Github.com/pion/dtls in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.4), 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-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In Github.com/pion/dtls, 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 A buffer that was used for inbound network traffic had no upper limit. Pion DTLS would buffer all network traffic from the remote user until the handshake completes or times out. An attacker could exploit this to cause excessive memory usage. ### Patches Upgrade to Pion DTLS v2.1.4 ### Workarounds No workarounds available, upgrade to Pion DTLS v2.1.4 ### References Thank you to [Juho Nurminen](https://github.com/jupenur) and the Mattermost team for discovering and reporting this. ### For more information If you have any questions or comments about this advisory: * Open an issue in [Pion DTLS](http://github.com/pion/dtls) * Email us at [team@pion.ly](mailto:team@pion.ly)

CVE-2022-29189 Affected Github.com/pion/dtls Versions

2 component(s)
Fixed Versions:
2.1.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/pion/dtls
Go
< 2.1.4
2.1.4
github.com/pion/dtls/v2
Go
< 2.1.4
2.1.4

References

Frequently Asked Questions

What is CVE-2022-29189?
CVE-2022-29189 is a security vulnerability in Github.com/pion/dtls involving Pion/DTLS contains buffer for inbound DTLS fragments with no limit under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which Github.com/pion/dtls versions are affected?
Affected versions include releases prior to 2.1.4 across affected packages: github.com/pion/dtls, github.com/pion/dtls/v2.
What version fixes CVE-2022-29189?
Upgrading to 2.1.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/pion/dtls affected?
Yes, github.com/pion/dtls is affected in releases prior to 2.1.4. Upgrade your dependency to 2.1.4 or later.
Is github.com/pion/dtls/v2 affected?
Yes, github.com/pion/dtls/v2 is affected in releases prior to 2.1.4. Upgrade your dependency to 2.1.4 or later.
What is the CVSS score of CVE-2022-29189?
CVE-2022-29189 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2022-29189?
CVE-2022-29189 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.).
How can I check Go dependencies for CVE-2022-29189?
Run the dependency tree command: 'inspect dependencies for github.com/pion/dtls'. 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-cx94-mrg9-rq4j",
  "modified" : "2023-08-29T23:31:24Z",
  "published" : "2022-05-24T22:04:38Z",
  "aliases" : [ "CVE-2022-29189" ],
  "summary" : "Pion/DTLS contains buffer for inbound DTLS fragments with no limit",
  "details" : "### Impact\nA buffer that was used for inbound network traffic had no upper limit. Pion DTLS would buffer all network traffic from the remote user until the handshake completes or times out. An attacker could exploit this to cause excessive memory usage.\n\n### Patches\nUpgrade to Pion DTLS v2.1.4\n\n### Workarounds\nNo workarounds available, upgrade to Pion DTLS v2.1.4\n\n### References\nThank you to [Juho Nurminen](https://github.com/jupenur) and the Mattermost team for discovering and reporting this. \n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Pion DTLS](http://github.com/pion/dtls)\n* Email us at [team@pion.ly](mailto:team@pion.ly)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pion/dtls"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/pion/dtls/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pion/dtls/security/advisories/GHSA-cx94-mrg9-rq4j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29189"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pion/dtls/commit/a6397ff7282bc56dc37a68ea9211702edb4de1de"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pion/dtls/releases/tag/v2.1.4"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0461"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/pion/dtls"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-120" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-05-24T22:04:38Z",
    "nvd_published_at" : "2022-05-21T00:15:00Z"
  }
}