GO-2022-0201

    Dashboard / Vulnerabilities / GO-2022-0201

    GO-2022-0201

    Published: 9 Aug 2022Last Modified: 20 May 2024
    Aliases:

    Summary: Remote command execution via "go get" command with cgo in cmd/go

    Details: The "go get" command with cgo is vulnerable to remote command execution by leveraging the gcc or clang plugin feature. When cgo is enabled, the build step during "go get" invokes the host C compiler, gcc or clang, adding compiler flags specified in the Go source files. Both gcc and clang support a plugin mechanism in which a shared-library plugin is loaded into the compiler, as directed by compiler flags. This means that a Go package repository can contain an attack.so file along with a Go source file that says (for example) "// #cgo CFLAGS: -fplugin=attack.so" causing the attack plugin to be loaded into the host C compiler during the build. Gcc and clang plugins are completely unrestricted in their access to the host system.

    Affected packages

    Package

    Name: toolchain

    Purl: pkg:golang/toolchain

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -1.8.7

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GO-2022-0201 | CVE-DB