Skip to content
Fencer Intel
medium 6.8

CVE-2018-16874 json

Directory traversal via "go get" command in cmd/go

published 7y ago modified 4mo ago also GO-2022-0190 , EUVD-2018-8665

cvss
6.8
version 3.0, CNA
cisa kev
Not listed
not in CISA's catalog
epss
5.0%
EPSS 5.0% chance of exploitation in 30 days, percentile 92%
public exploits
0
none known

Summary

In Go before 1.10.6 and 1.11.x before 1.11.3, the "go get" command is vulnerable to directory traversal when executed with the import path of a malicious Go package which contains curly braces (both '{' and '}' characters). Specifically, it is only vulnerable in GOPATH mode, but not in module mode (the distinction is documented at https://golang.org/cmd/go/#hdr-Module_aware_go_get). The attacker can cause an arbitrary filesystem write, which can lead to code execution.

Patch / fix

  • go toolchain 1.10.6, 1.11.3
  • golang go 1.10.6, 1.11.3
  • docker-stable SLES for SAP 15 SP5, SLES for SAP 15 SP4, SLES for SAP 15 SP3 +12 more 24.0.9_ce-150000.1.25.1
  • etcd openSUSE Leap 15.6, openSUSE Leap 15.5 3.5.12-150000.7.6.1
  • runc SLE Module for Containers 12 1.0.0~rc93-16.8.1
  • docker SLE Module for Containers 12 20.10.6_ce-98.66.1
  • containerd SLE Module for Containers 12 1.4.4-16.38.1
  • helm-mirror SLE Module for Containers 15 SP1, SLE Module for Containers 15 0.2.1-1.7.1
  • golang-github-docker-libnetwork SLE Module for Containers 15 SP1, SLE Module for Containers 15 0.7.0.1+gitr2726_872f0a83c98a-4.12.1
  • docker SLE Module for Containers 15 SP1, SLE Module for Containers 15 18.09.6_ce-6.17.1

suse advisories SUSE-SU-2025:03545-1SUSE-SU-2025:03540-1SUSE-SU-2024:3656-1SUSE-SU-2021:1458-1SUSE-SU-2019:0048-2SUSE-SU-2019:1234-2

  • helm3 openSUSE Tumbleweed 3.19.2-1.1
  • docker-stable openSUSE Tumbleweed 24.0.9_ce-15.1
  • containerd openSUSE Tumbleweed 1.4.8-2.2
  • cri-o openSUSE Tumbleweed 1.22.0-1.2
  • docker openSUSE Tumbleweed 20.10.6_ce-2.1
  • etcd openSUSE Tumbleweed 3.4.16-3.1
  • flannel openSUSE Tumbleweed 0.14.0-1.2
  • go openSUSE Tumbleweed 1.17-1.1

opensuse advisories openSUSE-SU-2025:15779-1openSUSE-SU-2025:15589-1openSUSE-SU-2024:10693-1openSUSE-SU-2024:10699-1openSUSE-SU-2024:10722-1openSUSE-SU-2024:10741-1

  • go Arch Linux 2:1.11.3-1

arch linux advisories AVG-835

Is CVE-2018-16874 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2018-16874 updated cvss 6.8

golang: "go get" vulnerable to directory traversal via malicious package

  • Red Hat Ceph Storage 2 golang, golang-bin, golang-src Red Hat Ceph Storage 3 golang, golang-bin, golang-src Red Hat Enterprise Linux 7 golang, golang-bin, golang-src, golang-misc, golang-tests Red Hat OpenStack Platform 8 (Liberty) Operational Tools golang, golang-src, golang-pkg-linux-amd64, golang-pkg-bin-linux-amd64 Red Hat OpenStack Platform 9 (Mitaka) Operational Tools golang, golang-bin, golang-src Red Hat Storage 3 golang, golang-bin, golang-src, golang-misc, golang-tests
    affected: no fix planned “Will not fix”
  • Red Hat Enterprise Linux 8 golang, go-toolset, golang-bin, golang-src, golang-misc, golang-race, +1 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

5.04% chance of exploitation in the next 30 days, higher than 92% of all scored CVEs (FIRST EPSS, 2026-11-09).

CVSS scores

assigned by version score vector
CNA 3.0 6.8 CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
NVD 3.1 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 2.0 6.8 AV:N/AC:M/Au:N/C:P/I:P/A:P

Affected packages

ecosystem package affected fixed in
go toolchain
<1.10.6
>=1.11.0-0, <1.11.3
1.10.6
1.11.3

Affected products

  • [UNKNOWN] golang

Classification

Weakness
  • CWE-20 Improper Input Validation
  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.