Skip to content

go/parser: stack exhaustion in all Parse* functions #53616

Closed

Description

@tatianab

Calling any of the Parse functions on Go source code which contains deeply nested types or declarations can cause a panic due to stack exhaustion.

Thanks to Juho Nurminen of Mattermost for reporting this issue.

This is CVE-2022-1962.

(This was a PRIVATE issue tracked in http://b/236145171 and fixed by http://tg/1491025.)

/cc https://github.com/orgs/golang/teams/security and https://github.com/orgs/golang/teams/release

Activity

  1. added this to the Go1.19 milestone on Jun 29, 2022
  2. tatianab commented on Jul 6, 2022

    @tatianab
    Author

    @gopherbot please open backport issues for this security fix

  3. gopherbot commented on Jul 6, 2022

    @gopherbot
    Contributor

    Backport issue(s) opened: #53707 (for 1.17), #53708 (for 1.18).

    Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

  4. gopherbot commented on Jul 12, 2022

    @gopherbot
    Contributor

    Change https://go.dev/cl/417056 mentions this issue: [release-branch.go1.18] go/parser: limit recursion depth

  5. gopherbot commented on Jul 12, 2022

    @gopherbot
    Contributor

    Change https://go.dev/cl/417063 mentions this issue: go/parser: limit recursion depth

  6. gopherbot commented on Jul 12, 2022

    @gopherbot
    Contributor

    Change https://go.dev/cl/417070 mentions this issue: [release-branch.go1.17] go/parser: limit recursion depth

  7. changed the title [-]security: fix CVE-2022-1962[/-] [+]go/parser: stack exhaustion in all Parse* functions[/+] on Jul 12, 2022
  8. added a commit that references this issue on Aug 10, 2022
    335c65e
  9. locked and limited conversation to collaborators on Jul 12, 2023
  10. added a commit that references this issue on Feb 10, 2024
    695be96
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

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions