CVE-2023-39323: Arbitrary code execution during build via line directives in cmd/go

Published Oct 5, 2023
·
Updated

Arbitrary code execution during build via line directives in cmd/go

Other sources

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.

Launchpad

Affected Software

17 affected componentsFixes available
debian/golang-1.15<=1.15.15-1~deb11u4
debian/golang-1.19<=1.19.8-2
Golang Go<1.20.9
Golang Go>=1.21.0<1.21.2
Fedoraproject Fedora=37
Fedoraproject Fedora=38
Fedoraproject Fedora=39
F5 BIG-IP Next SPK>=2.0.0<=2.0.1
F5 BIG-IP Next SPK>=1.7.0<=1.9.2
F5 BIG-IP Next CNF>=2.0.0<=2.0.1
F5 BIG-IP Next CNF>=1.1.0<=1.4.1
F5 BIG-IP Next for Kubernetes=2.0.0
Microsoft cbl2 golang 1.20.10-1
Microsoft azl3 golang 1.20.10-1
Microsoft cbl2 golang 1.17.13-2
Microsoft cbl2 golang 1.18.8-7
Microsoft cbl2 golang 1.21.6-1

Remediation

Event History

Oct 5, 2023
CVE Published
via MITRE·08:36 PM
Data Sourced
via MITRE·08:36 PM
DescriptionWeakness
Jan 12, 2024
Data Sourced
via Launchpad·12:24 AM
Description
Nov 15, 2024
Data Sourced
via Ubuntu·02:15 AM
RemedyDescriptionSeverityAffected Software
Jul 16, 2025
Advisory Published
via F5·09:19 PM
Data Sourced
via F5·09:19 PM
DescriptionSeverityWeaknessAffected Software
Sep 4, 2025
Data Sourced
via Microsoft·04:58 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·04:58 AM
Affected Software
Updated
via Microsoft·04:58 AM
Affected Software
Updated
via Microsoft·04:58 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the vulnerability ID for this issue?

The vulnerability ID for this issue is CVE-2023-39323.

2

What is the severity level of CVE-2023-39323?

CVE-2023-39323 has a severity level of critical.

3

How can line directives be used to bypass restrictions on go:cgo_ directives?

Line directives ("//line") can be used to bypass the restrictions on "//go:cgo_" directives by allowing blocked linker and compiler flags to be passed during compilation.

4

What software is affected by CVE-2023-39323?

Golang Go versions up to and including 1.20.9, as well as version 1.21.0 up to but excluding 1.21.2, are affected by CVE-2023-39323.

5

How can I fix CVE-2023-39323?

To fix CVE-2023-39323, it is recommended to update Golang Go to a version that is not affected by the vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203