# CVE-2018-6574: Code injection in n/a

> Attackers can execute arbitrary code during Go source builds by exploiting unblocked compiler plugin arguments in the go get command.

- **Severity:** High 7.8 (`CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Feb 2018
- **Updated:** 5 Aug 2024
- **Also known as:** GHSA-c37c-qq99-c897, GO-2022-0201, MGASA-2018-0144, RHSA-2018:1304, UBUNTU-CVE-2018-6574, openSUSE-SU-2018:0588-1, openSUSE-SU-2018:0589-1, openSUSE-SU-2018:0628-1, openSUSE-SU-2018:0629-1

## What is CVE-2018-6574?

CVE-2018-6574 is a high-severity code injection vulnerability in Debian Debian Linux, published on 7 Feb 2018. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Go before 1.8.7, Go 1.9.x before 1.9.4, and Go 1.10 pre-releases before Go 1.10rc2 allow "go get" remote command execution during source code build, by leveraging the gcc or clang plugin feature, because -fplugin= and -plugin= arguments were not blocked.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2018-6574?

1 open source package ship an affected version, including toolchain. It affects 6 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `toolchain` | Go | All versions | 1.8.7, 1.9.4 |
| `go-toolset-7` | Red Hat:devtools:2018 | All versions | 0:1.8-14.el7 |
| `go-toolset-7-build` | Red Hat:devtools:2018 | All versions | 0:1.8-14.el7 |
| `go-toolset-7-golang` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-golang-bin` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-golang-docs` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-golang-misc` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-golang-race` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-golang-src` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-golang-tests` | Red Hat:devtools:2018 | All versions | 0:1.8.7-2.el7 |
| `go-toolset-7-runtime` | Red Hat:devtools:2018 | All versions | 0:1.8-14.el7 |
| `go-toolset-7-scldevel` | Red Hat:devtools:2018 | All versions | 0:1.8-14.el7 |
| `go` | SUSE:Package Hub 12 | All versions | 1.9.4-15.1 |
| `go` | SUSE:Package Hub 12 | All versions | 1.9.4-15.1 |
| `go1.8` | SUSE:Package Hub 12 | All versions | 1.8.7-5.1 |
| `go1.8` | SUSE:Package Hub 12 | All versions | 1.8.7-5.1 |
| `go1.9` | SUSE:Package Hub 12 | All versions | 1.9.4-5.1 |
| `go1.9` | SUSE:Package Hub 12 | All versions | 1.9.4-5.1 |

Products: Debian Debian Linux, Golang Go, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server Eus, Redhat Enterprise Linux Server Tus.

## How do I fix CVE-2018-6574?

Upgrade toolchain to a fixed version for your release line: 1.8.7 or 1.9.4.

## Is CVE-2018-6574 being exploited?

There is no known exploitation of CVE-2018-6574 in the wild and no public exploit code.

Public exploit code:

- CVE-2018-6574 POC : golang 'go get' remote command execution during source code build (github_poc): https://github.com/neargle/Go-Get-RCE-CVE-2018-6574-POC
- https://github.com/frozenkp/CVE-2018-6574 (github_poc): https://github.com/frozenkp/CVE-2018-6574
- CVE-2018-6574 for pentesterLAB (github_poc): https://github.com/wb4r/go-get-rce
- CVE-2018-6574: go get RCE solution for pentesterlab challenge (github_poc): https://github.com/Malone5923/CVE-2018-6574-go-get-RCE
- Exploit for remote command execution in Golang go get command. (github_poc): https://github.com/Devang-Solanki/CVE-2018-6574
- https://github.com/ItsFadinG/CVE-2018-6574 (github_poc): https://github.com/ItsFadinG/CVE-2018-6574

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-6574 and fix it if it is affected.

What it is: CVE-2018-6574 is a high-severity code injection vulnerability in Debian Debian Linux, published on 7 Feb 2018. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2018-6574 in the wild and no public exploit code.

Affected packages and fixed versions:
- toolchain (Go): affected all versions; fixed in 1.8.7, 1.9.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2018-6574/ (Markdown: https://insights.sbomify.com/CVE-2018-6574/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2018-6574
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2018-6574
- OSV: https://osv.dev/vulnerability/CVE-2018-6574

---
From sbomify Insights: https://insights.sbomify.com/CVE-2018-6574/
Summaries are generated and may contain mistakes; the official description above is the record.
