CVE-2020-24356: Github.com/cloudflare/cloudflared Local Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-hgwp-4vp4-qmm2
CVSS 7.8
CWE-427
Published
Advisory Summary

CVE-2020-24356 is a HIGH (CVSS 7.8) local privilege escalation vulnerability (CWE-427: Uncontrolled Search Path Element) affecting Github.com/cloudflare/cloudflared libraries in the Go ecosystem. The issue involves local privilege escalation in cloudflared. Remediation is available by upgrading affected packages to version 0.0.0-20200820025921-9323844ea773.

CVE-2020-24356 at a Glance

CVE Identifier CVE-2020-24356
GHSA Identifier GHSA-hgwp-4vp4-qmm2
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-427: Uncontrolled Search Path Element
Affected Product Github.com/cloudflare/cloudflared
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.8

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

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

How to Fix CVE-2020-24356

To remediate this vulnerability, upgrade all affected Github.com/cloudflare/cloudflared 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/cloudflare/cloudflared fixed: 0.0.0-20200820025921-9323844ea773
Upgrade github.com/cloudflare/cloudflared to 0.0.0-20200820025921-9323844ea773
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/cloudflare/cloudflared

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-24356, inspect your project dependencies for Github.com/cloudflare/cloudflared:

inspect dependencies for github.com/cloudflare/cloudflared

Analyze the terminal output to locate any version of Github.com/cloudflare/cloudflared in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20200820025921-9323844ea773), 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-427: Uncontrolled Search Path Element, where the product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors. In Github.com/cloudflare/cloudflared, 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

In `cloudflared` versions < 2020.8.1 (corresponding to 0.0.0-20200820025921-9323844ea773 on pkg.go.dev) on Windows, if an administrator has started `cloudflared` and set it to read configuration files from a certain directory, an unprivileged user can exploit a misconfiguration in order to escalate privileges and execute system-level commands. The misconfiguration was due to the way that `cloudflared` reads its configuration file. One of the locations that `cloudflared` reads from (C:\etc\) is not a secure by default directory due to the fact that Windows does not enforce access controls on this directory without further controls applied. A malformed config.yaml file can be written by any user. Upon reading this config, `cloudflared` would output an error message to a log file defined in the malformed config. The user-controlled log file location could be set to a specific location that Windows will execute when any user logs in.

CVE-2020-24356 Affected Github.com/cloudflare/cloudflared Versions

1 component(s)
Fixed Versions:
0.0.0-20200820025921-9323844ea773
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cloudflare/cloudflared
Go
< 0.0.0-20200820025921-9323844ea773
0.0.0-20200820025921-9323844ea773

References

Frequently Asked Questions

What is CVE-2020-24356?
CVE-2020-24356 is a security vulnerability in Github.com/cloudflare/cloudflared involving Local Privilege Escalation in cloudflared under CWE-427: Uncontrolled Search Path Element.
Which Github.com/cloudflare/cloudflared versions are affected?
Affected versions include releases prior to 0.0.0-20200820025921-9323844ea773 across affected packages: github.com/cloudflare/cloudflared.
What version fixes CVE-2020-24356?
Upgrading to 0.0.0-20200820025921-9323844ea773 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cloudflare/cloudflared affected?
Yes, github.com/cloudflare/cloudflared is affected in releases prior to 0.0.0-20200820025921-9323844ea773. Upgrade your dependency to 0.0.0-20200820025921-9323844ea773 or later.
What is the CVSS score of CVE-2020-24356?
CVE-2020-24356 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-24356?
CVE-2020-24356 is classified under CWE-427: Uncontrolled Search Path Element (The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.).
How can I check Go dependencies for CVE-2020-24356?
Run the dependency tree command: 'inspect dependencies for github.com/cloudflare/cloudflared'. 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-hgwp-4vp4-qmm2",
  "modified" : "2023-03-02T21:10:45Z",
  "published" : "2021-05-24T16:56:35Z",
  "aliases" : [ "CVE-2020-24356" ],
  "summary" : "Local Privilege Escalation in cloudflared",
  "details" : "In `cloudflared` versions < 2020.8.1 (corresponding to 0.0.0-20200820025921-9323844ea773 on pkg.go.dev) on Windows, if an administrator has started `cloudflared` and set it to read configuration files from a certain directory, an unprivileged user can exploit a misconfiguration in order to escalate privileges and execute system-level commands. The misconfiguration was due to the way that `cloudflared` reads its configuration file. One of the locations that `cloudflared` reads from (C:\\etc\\) is not a secure by default directory due to the fact that Windows does not enforce access controls on this directory without further controls applied. A malformed config.yaml file can be written by any user. Upon reading this config, `cloudflared` would output an error message to a log file defined in the malformed config. The user-controlled log file location could be set to a specific location that Windows will execute when any user logs in.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cloudflare/cloudflared"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20200820025921-9323844ea773"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/cloudflared/security/advisories/GHSA-hgwp-4vp4-qmm2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-24356"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/cloudflared/commit/9323844ea773b1444460fa09295ab8c01a88d97e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudflare/cloudflared"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-427" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-24T16:52:03Z",
    "nvd_published_at" : "2020-10-02T15:15:00Z"
  }
}