Description
Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives, allowing blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution of arbitrary code when running "go build". The line directive requires the absolute path of the file in which the directive lives, which makes exploiting this issue significantly more complex.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Go toolchain | cmd/go | < 1.20.9, 1.21.0-0 – < 1.21.2 | 1.20.9 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 12 | golang-1.19 | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | golang-1.17 | 1.17.13-3ubuntu1.3 | USN-7111-1 |
| Ubuntu 22.04 LTS | golang-1.18 | 1.18.1-1ubuntu1.2 | USN-7109-1 |
| Ubuntu 22.04 LTS | golang-1.20 | 1.20.3-1ubuntu0.1~22.04.1 | USN-6574-1 |
| Ubuntu 22.04 LTS | golang-1.21 | 1.21.1-1~ubuntu22.04.2 | USN-6574-1 |
| Ubuntu 20.04 LTS | golang-1.18 | 1.18.1-1ubuntu1~20.04.3 | USN-7109-1 |
| Ubuntu 20.04 LTS | golang-1.20 | 1.20.3-1ubuntu0.1~20.04.1 | USN-6574-1 |
| Ubuntu 20.04 LTS | golang-1.21 | 1.21.1-1~ubuntu20.04.2 | USN-6574-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 18.04 LTS | golang-1.18 | 1.18.1-1ubuntu1~18.04.4+esm1 | USN-7109-1 |
| Ubuntu Pro 16.04 LTS | golang-1.18 | 1.18.1-1ubuntu1~16.04.6+esm1 | USN-7109-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 8 | delve | 1.20.2-1.module+el8.9.0+18926+5193682d | RHBA-2023:6928 |
| RHEL 8 | golang +6 | 1.20.10-1.module+el8.9.0+20382+04f7fe80 | RHBA-2023:6928 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP5 | go1.20 | 1.20.9-150000.1.26.1 | SUSE-SU-2023:4018-1 |
| SLES 15 SP5 | go1.20-openssl | 1.20.11.1-150000.1.14.1 | SUSE-SU-2023:4472-1 |
| SLES 15 SP5 | go1.21 | 1.21.2-150000.1.9.1 | SUSE-SU-2023:4017-1 |
| SLES 15 SP5 | go1.21-openssl | 1.21.4.1-150000.1.5.1 | SUSE-SU-2023:4469-1 |
| SLES 15 SP4 | go1.20 | 1.20.9-150000.1.26.1 | SUSE-SU-2023:4018-1 |
| SLES 15 SP4 | go1.20-openssl | 1.20.11.1-150000.1.14.1 | SUSE-SU-2023:4472-1 |
| SLES 15 SP4 | go1.21 | 1.21.2-150000.1.9.1 | SUSE-SU-2023:4017-1 |
| SLES 15 SP4 | go1.21-openssl | 1.21.4.1-150000.1.5.1 | SUSE-SU-2023:4469-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SUSE Package Hub 12 | go | 1.21-41.1 | openSUSE-SU-2023:0360-1 |
| SUSE Package Hub 12 | go1.21 | 1.21.3-2.1 | openSUSE-SU-2023:0360-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | go1.20 | 1.20.9-1.1 | openSUSE-SU-2024:13306-1 |
| openSUSE Tumbleweed | go1.21 | 1.21.2-1.1 | openSUSE-SU-2024:13307-1 |
| openSUSE Leap 15.5 | go1.20 | 1.20.9-150000.1.26.1 | SUSE-SU-2023:4018-1 |
| openSUSE Leap 15.5 | go1.20-openssl | 1.20.11.1-150000.1.14.1 | SUSE-SU-2023:4472-1 |
| openSUSE Leap 15.5 | go1.21 | 1.21.2-150000.1.9.1 | SUSE-SU-2023:4017-1 |
| openSUSE Leap 15.5 | go1.21-openssl | 1.21.4.1-150000.1.5.1 | SUSE-SU-2023:4469-1 |
| openSUSE Leap 15.4 | go1.20 | 1.20.9-150000.1.26.1 | SUSE-SU-2023:4018-1 |
| openSUSE Leap 15.4 | go1.20-openssl | 1.20.11.1-150000.1.14.1 | SUSE-SU-2023:4472-1 |
| openSUSE Leap 15.4 | go1.21 | 1.21.2-150000.1.9.1 | SUSE-SU-2023:4017-1 |
| openSUSE Leap 15.4 | go1.21-openssl | 1.21.4.1-150000.1.5.1 | SUSE-SU-2023:4469-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | go | 1.21.2-r0 | — |
| Alpine v3.23 | go | 1.21.2-r0 | — |
| Alpine v3.22 | go | 1.21.2-r0 | — |
| Alpine v3.21 | go | 1.21.2-r0 | — |
| Alpine v3.20 | go | 1.21.2-r0 | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | go | 1.21.2-r0 | — |
| Alpine v3.18 | go | 1.20.9-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | ecs-service-connect-agent | v1.27.2.0-1.amzn2023 | ALAS2023-2023-420 |
| Amazon Linux 2023 | golang +6 | 1.20.10-1.amzn2023.0.1 | ALAS2023-2023-394 |
| Amazon Linux 2 | golang +6 | 1.20.10-1.amzn2.0.1 | ALAS2-2023-2313 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | golang | 1.20.10-1 | — |
| Azure Linux 2 (CBL-Mariner) | golang | 1.20.10-1 | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | katib-earlystopping +8 | 0.19.0-r31 | — |
| Wolfi rolling | katib-suggestion-goptuna-compat | 0.19.0-r40 | — |
| Wolfi rolling | kind | 0.21.0-r0 | — |
| Wolfi rolling | metrics-server | 0.6.4-r2 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Go | toolchain | < 1.20.9 · >= 1.21.0-0, < 1.21.2 | 1.20.9, 1.21.2 | GO-2023-2095 |
Advisories 15
- RHBA-2023:6928 Red Hat Bug Fix Advisory: go-toolset:rhel8 bug fix and enhancement update Red Hat Security Advisories (RHSA) · Oct 20, 2026
- USN-7109-1 golang-1.18 vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- USN-7111-1 golang-1.17 vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026
- USN-6574-1 Go vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026
- SUSE-SU-2023:4469-1 Security update for go1.21-openssl SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:4018-1 Security update for go1.20 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2023:0360-1 Security update for go1.21 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:13307-1 go1.21-1.21.2-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:4017-1 Security update for go1.21 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:13306-1 go1.20-1.20.9-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:4472-1 Security update for go1.20-openssl SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2023-2516 Golang Go: Mehre Schwachstellen BSI CERT-Bund (WID) · Jul 16, 2025
- ALAS2-2023-2313 Important: golang security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Jan 3, 2024
- ALAS2023-2023-420 Important: ecs-service-connect-agent security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Nov 3, 2023
- ALAS2023-2023-394 Important: golang security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Oct 18, 2023
References
- https://go.dev/issue/63211
- https://go.dev/cl/533215
- https://groups.google.com/g/golang-announce/c/XBa1oHDevAo
- https://pkg.go.dev/vuln/GO-2023-2095
- https://security.netapp.com/advisory/ntap-20231020-0001/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KSEGD2IWKNUO3DWY4KQGUQM5BISRWHQE/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CLB4TW7KALB3EEQWNWCN7OUIWWVWWCG2/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XFOIBB4YFICHDM7IBOP7PWXW3FX4HLL2/
- https://security.gentoo.org/glsa/202311-09