Skip to content

cmd/go: cgo code injection [CVE-2023-29402] #60167

Closed

Description

@rolandshoemaker

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

  1. added this to the Go1.21 milestone on May 12, 2023
  2. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on May 12, 2023
  3. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    and removed
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on May 19, 2023
  4. rolandshoemaker commented on May 30, 2023

    @rolandshoemaker
    MemberAuthor

    @gopherbot please open backport issues.

  5. gopherbot commented on May 30, 2023

    @gopherbot
    Contributor

    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.

  6. gopherbot commented on Jun 6, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/501218 mentions this issue: [release-branch.go1.19] cmd/go: disallow package directories containing newlines

  7. gopherbot commented on Jun 6, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/501222 mentions this issue: [release-branch.go1.20] cmd/go: disallow package directories containing newlines

  8. gopherbot commented on Jun 6, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/501226 mentions this issue: cmd/go: disallow package directories containing newlines

  9. changed the title [-]security: fix CVE-2023-29402[/-] [+]cmd/go: cgo code injection [CVE-2023-29402][/+] on Jun 6, 2023
  10. 19 remaining items

  11. ArchanaWind commented on Jun 22, 2023

    @ArchanaWind

    Hi,

    Could you please confirm Is this issue present in go1.17.13

    Thanks in advance

  12. bcmills commented on Jun 22, 2023

    @bcmills
    Contributor
  13. ArchanaWind commented on Jun 23, 2023

    @ArchanaWind

    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

  14. ianlancetaylor commented on Jun 23, 2023

    @ianlancetaylor
    Contributor

    @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.

  15. bcmills commented on Jun 23, 2023

    @bcmills
    Contributor

    @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.

  16. ArchanaWind commented on Jun 25, 2023

    @ArchanaWind

    @ianlancetaylor & @bcmills Fine Thank You

  17. added a commit that references this issue on Apr 29, 2024
    4dae3bb
  18. locked and limited conversation to collaborators 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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions