cmd/go: cgo code injection [CVE-2023-29402] · Issue #60167 · golang/go · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert cmd/go: cgo code injection [CVE-2023-29402] #60167 New issue Copy link New issue Copy link Closed Closed cmd/go: cgo code injection [CVE-2023-29402] #60167 Copy link Labels FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
The path to resolution is known, but the work has not been done. Security release-blocker Milestone Go1.21 Description rolandshoemaker opened on May 12, 2023 Issue body actions The go command may generate unexpected code at build time when using cgo. This may result in unexpected behavior when running a go program which uses cgo. This may occur when running an untrusted module which contains directories with newline characters in their names.
Modules which are retrieved using the go command, i.e. via "go get", are not affected (modules retrieved using GOPATH-mode, i.e. GO111MODULE=off, may be affected). Thanks to Juho Nurminen of Mattermost for reporting this issue. This is a PRIVATE issue for CVE-2023-29402 , tracked in http://b/280799945 /cc @golang/security and @golang/release Activity Next rolandshoemaker added Security release-blocker on May 12, 2023 dmitshur added this to the Go1.21 milestone on May 12, 2023 cherrymui added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. on May 12, 2023 rolandshoemaker added NeedsFix The path to resolution is known, but the work has not been done. The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. on May 19, 2023 rolandshoemaker commented on May 30, 2023 rolandshoemaker on May 30, 2023 Member Author More actions @gopherbot please open backport issues. gopherbot commented on May 30, 2023 gopherbot on May 30, 2023 Contributor More actions Backport issue(s) opened: #60515 (for 1.19), #60516 (for 1.20).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases . gopherbot commented on Jun 6, 2023 gopherbot on Jun 6, 2023 Contributor More actions Change https://go.dev/cl/501218 mentions this issue: [release-branch.go1.19] cmd/go: disallow package directories containing newlines gopherbot commented on Jun 6, 2023 gopherbot on Jun 6, 2023 Contributor More actions Change https://go.dev/cl/501222 mentions this issue: [release-branch.go1.20] cmd/go: disallow package directories containing newlines gopherbot commented on Jun 6, 2023 gopherbot on Jun 6, 2023 Contributor More actions Change https://go.dev/cl/501226 mentions this issue: cmd/go: disallow package directories containing newlines gopherbot added 2 commits that reference this issue on Jun 6, 2023 [release-branch.go1.20] cmd/go: disallow package directories containi… c0ed873 [release-branch.go1.19] cmd/go: disallow package directories containi… c160b49 dr2chase changed the title [-] security: fix CVE-2023-29402 [/-] [+] cmd/go: cgo code injection [CVE-2023-29402] [/+] on Jun 6, 2023 gopherbot closed this as completed in 4dae3bb on Jun 6, 2023 19 remaining items gopherbot added 6 commits that reference this issue on Jun 13, 2023 [release-branch.go1.19] cmd/cover: error out if a requested source fi… 6d44c15 [release-branch.go1.19] go/printer: error out of Fprint when it would… 0b0f86e [release-branch.go1.20] cmd/go: fix TestScript/build_cwd_newline with… 6c606fc [release-branch.go1.20] cmd/cgo: error out if the source path used in… 4719048 [release-branch.go1.20] cmd/cover: error out if a requested source fi… 4959424 [release-branch.go1.20] go/printer: error out of Fprint when it would… d51e322 ArchanaWind commented on Jun 22, 2023 ArchanaWind on Jun 22, 2023 More actions Hi, Could you please confirm Is this issue present in go1.17.13 Thanks in advance bcmills commented on Jun 22, 2023 bcmills on Jun 22, 2023 Contributor More actions Yes — see https://pkg.go.dev/vuln/GO-2023-1839 .
ArchanaWind commented on Jun 23, 2023 ArchanaWind on Jun 23, 2023 More actions Hi @bcmills , Thank you for the quick response, I have backported the CVE fix to the go1.17.13 version, Could you please review the attached patch and provide you're comments Thanks in advance CVE-2023-29402.patch ianlancetaylor commented on Jun 23, 2023 ianlancetaylor on Jun 23, 2023 Contributor More actions @ArchanaWind Just to be clear, Go 1.17 is no longer supported.
The only currently supported versions of Go are Go 1.19 and Go 1.20. bcmills commented on Jun 23, 2023 bcmills on Jun 23, 2023 Contributor More actions @ArchanaWind , I've got a long backlog of code reviews at the moment. Given that only the two most recent Go releases are supported by the Go team, I do not personally plan to review patches for the unsupported releases. ArchanaWind commented on Jun 25, 2023 ArchanaWind on Jun 25, 2023 More actions @ianlancetaylor & @bcmills Fine Thank You salewski added a commit that references this issue on Apr 29, 2024 cmd/go: disallow package directories containing newlines This issue will close once commit 4dae3bb is merged into the 'master' branch.
4dae3bb golang locked and limited conversation to collaborators on Jun 24, 2024 gopherbot added FrozenDueToAge on Jun 24, 2024 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Metadata Metadata Assignees No one assigned Labels FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. The path to resolution is known, but the work has not been done.
Security release-blocker Type No type Projects No projects Milestone Go1.21 Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.