Skip to content

html/template: improper handling of empty HTML attributes #59722

Description

@rolandshoemaker

Templates containing actions in unquoted HTML attributes (e.g. "attr={{.}}") executed with empty input could result in output that would have unexpected results when parsed due to HTML normalization rules. This may allow injection of arbitrary attributes into tags.

Thanks to Juho Nurminen of Mattermost for reporting this issue.

This is CVE-2023-29400 and Go issue https://go.dev/issue/59722.

/cc @golang/security and @golang/release

Activity

  1. added this to the Go1.21 milestone on Apr 21, 2023
  2. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Apr 21, 2023
  3. neild commented on Apr 24, 2023

    @neild
    Contributor

    @gopherbot please open backport issues for this security fix

  4. gopherbot commented on Apr 24, 2023

    @gopherbot
    Contributor

    Backport issue(s) opened: #59815 (for 1.19), #59816 (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.

  5. gopherbot commented on May 2, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/491357 mentions this issue: [release-branch.go1.19] html/template: emit filterFailsafe for empty unquoted attr value

  6. gopherbot commented on May 2, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/491358 mentions this issue: [release-branch.go1.20] html/template: emit filterFailsafe for empty unquoted attr value

  7. changed the title [-]security: fix CVE-2023-29400[/-] [+]html/template: improper santization of CSS values[/+] on May 2, 2023
  8. changed the title [-]html/template: improper santization of CSS values[/-] [+]html/template: improper handling of empty HTML attributes[/+] on May 2, 2023
  9. gopherbot commented on May 2, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/491617 mentions this issue: html/template: emit filterFailsafe for empty unquoted attr value

  10. added a commit that references this issue on Apr 29, 2024
    0d34754
  11. locked and limited conversation to collaborators on May 1, 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