Bug 2217565 (CVE-2023-29404) - CVE-2023-29404 golang: cmd/go: go command may execute arbitrary code at build time when using cgo
Summary: CVE-2023-29404 golang: cmd/go: go command may execute arbitrary code at build...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2023-29404
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2217566 2217567 2217602 2217603 2217604 2217605 2217606 2217607 2217608 2217609 2217610 2217611 2217612 2217613 2217614
Blocks: 2217573
TreeView+ depends on / blocked
 
Reported: 2023-06-26 17:54 UTC by Pedro Sampaio
Modified: 2024-03-19 10:27 UTC (History)
16 users (show)

Fixed In Version: go 1.20.5, go 1.19.10
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in golang. The go command may execute arbitrary code at build time when using cgo. This can occur when running "go get" on a malicious module, or when running any other command which builds untrusted code. This can be triggered by linker flags, specified via a "#cgo LDFLAGS" directive. The arguments for a number of flags which are non-optional are incorrectly considered optional, allowing disallowed flags to be smuggled through the LDFLAGS sanitization. This affects usage of both the gc and gccgo compilers.
Clone Of:
Environment:
Last Closed: 2023-06-29 14:18:40 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2023:3940 0 None None None 2023-06-29 13:45:52 UTC
Red Hat Product Errata RHBA-2023:3941 0 None None None 2023-06-29 14:13:27 UTC
Red Hat Product Errata RHBA-2023:3956 0 None None None 2023-06-30 02:50:34 UTC
Red Hat Product Errata RHSA-2023:3920 0 None None None 2023-06-29 05:30:56 UTC
Red Hat Product Errata RHSA-2023:3922 0 None None None 2023-06-29 09:07:26 UTC
Red Hat Product Errata RHSA-2023:3923 0 None None None 2023-06-29 09:45:24 UTC

Description Pedro Sampaio 2023-06-26 17:54:29 UTC
The go command may execute arbitrary code at build time when using cgo. This may occur when running "go get" on a malicious module, or when running any other command which builds untrusted code. This is can by triggered by linker flags, specified via a "#cgo LDFLAGS" directive. The arguments for a number of flags which are non-optional are incorrectly considered optional, allowing disallowed flags to be smuggled through the LDFLAGS sanitization. This affects usage of both the gc and gccgo compilers.

https://go.dev/issue/60305
https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ
https://pkg.go.dev/vuln/GO-2023-1841
https://go.dev/cl/501225

Comment 1 Pedro Sampaio 2023-06-26 17:54:55 UTC
Created golang tracking bugs for this issue:

Affects: epel-all [bug 2217566]
Affects: fedora-all [bug 2217567]

Comment 3 errata-xmlrpc 2023-06-29 05:30:53 UTC
This issue has been addressed in the following products:

  Red Hat Developer Tools

Via RHSA-2023:3920 https://access.redhat.com/errata/RHSA-2023:3920

Comment 4 errata-xmlrpc 2023-06-29 09:07:24 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2023:3922 https://access.redhat.com/errata/RHSA-2023:3922

Comment 5 errata-xmlrpc 2023-06-29 09:45:22 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2023:3923 https://access.redhat.com/errata/RHSA-2023:3923

Comment 6 Product Security DevOps Team 2023-06-29 14:18:37 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2023-29404


Note You need to log in before you can comment on or make changes to this bug.