CVE-2022-36633: Github.com/gravitational/teleport Improper Token Validation Leading To Vulnerability

HIGH
Advisory Identifier: GHSA-6xf3-5hp7-xqqg
CVSS 8.8
CWE-20 CWE-77
Published
Advisory Summary

CVE-2022-36633 is a HIGH (CVSS 8.8) improper token validation leading to vulnerability (CWE-20: Improper Input Validation) affecting Github.com/gravitational/teleport libraries in the Go ecosystem. The issue involves improper token validation leading to code execution in teleport. Remediation is available by upgrading affected packages to version 8.3.17, 9.3.13, 10.1.2.

CVE-2022-36633 at a Glance

CVE Identifier CVE-2022-36633
GHSA Identifier GHSA-6xf3-5hp7-xqqg
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/gravitational/teleport
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:R/S:U/C:H/I:H/A:H).

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

How to Fix CVE-2022-36633

To remediate this vulnerability, upgrade all affected Github.com/gravitational/teleport 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/gravitational/teleport fixed: 8.3.17
Upgrade github.com/gravitational/teleport to 8.3.17
github.com/gravitational/teleport fixed: 9.3.13
Upgrade github.com/gravitational/teleport to 9.3.13
github.com/gravitational/teleport fixed: 10.1.2
Upgrade github.com/gravitational/teleport to 10.1.2
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/gravitational/teleport

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-36633, inspect your project dependencies for Github.com/gravitational/teleport:

inspect dependencies for github.com/gravitational/teleport

Analyze the terminal output to locate any version of Github.com/gravitational/teleport in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.3.17), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/gravitational/teleport, 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

Teleport 9.3.6 is vulnerable to Command injection leading to Remote Code Execution. An attacker can craft a malicious ssh agent installation link by URL encoding a bash escape with carriage return line feed. This url encoded payload can be used in place of a token and sent to a user in a social engineering attack. This is fully unauthenticated attack utilizing the trusted teleport server to deliver the payload.

CVE-2022-36633 Affected Github.com/gravitational/teleport Versions

3 component(s)
Fixed Versions:
8.3.179.3.1310.1.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gravitational/teleport
Go
< 8.3.17
8.3.17
github.com/gravitational/teleport
Go
≥ 9.0.0
< 9.3.13
9.3.13
github.com/gravitational/teleport
Go
≥ 10.0.0
< 10.1.2
10.1.2

References

Frequently Asked Questions

What is CVE-2022-36633?
CVE-2022-36633 is a security vulnerability in Github.com/gravitational/teleport involving Improper token validation leading to code execution in Teleport under CWE-20: Improper Input Validation.
Which Github.com/gravitational/teleport versions are affected?
Affected versions include releases prior to 8.3.17, 9.3.13, 10.1.2 across affected packages: github.com/gravitational/teleport.
What version fixes CVE-2022-36633?
Upgrading to 8.3.17, 9.3.13, 10.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gravitational/teleport affected?
Yes, github.com/gravitational/teleport is affected in releases prior to 8.3.17, 9.3.13, 10.1.2. Upgrade your dependency to 8.3.17, 9.3.13, 10.1.2 or later.
What is the CVSS score of CVE-2022-36633?
CVE-2022-36633 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-36633?
CVE-2022-36633 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2022-36633?
Run the dependency tree command: 'inspect dependencies for github.com/gravitational/teleport'. 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-6xf3-5hp7-xqqg",
  "modified" : "2022-09-27T08:28:17Z",
  "published" : "2022-08-25T00:00:28Z",
  "aliases" : [ "CVE-2022-36633" ],
  "summary" : "Improper token validation leading to code execution in Teleport",
  "details" : "Teleport 9.3.6 is vulnerable to Command injection leading to Remote Code Execution. An attacker can craft a malicious ssh agent installation link by URL encoding a bash escape with carriage return line feed. This url encoded payload can be used in place of a token and sent to a user in a social engineering attack. This is fully unauthenticated attack utilizing the trusted teleport server to deliver the payload.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gravitational/teleport"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.3.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gravitational/teleport"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0"
      }, {
        "fixed" : "9.3.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gravitational/teleport"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36633"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gravitational/teleport/pull/14726"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gravitational/teleport/pull/14726/commits/46c23b9b64b944d1e82d2c8a79083f291ffdd3b6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gravitational/teleport"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gravitational/teleport/releases/tag/v10.1.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gravitational/teleport/releases/tag/v8.3.17"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gravitational/teleport/releases/tag/v9.3.13"
  }, {
    "type" : "WEB",
    "url" : "https://packetstormsecurity.com/files/168137/Teleport-9.3.6-Command-Injection.html"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/168477/Teleport-10.1.1-Remote-Code-Execution.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-30T20:53:54Z",
    "nvd_published_at" : "2022-08-24T13:15:00Z"
  }
}