Skip to content

html/template: improper handling of JavaScript whitespace #59721

Closed

Description

@rolandshoemaker

Not all valid JavaScript whitespace characters were considered to be whitespace. Templates containing whitespace characters outside of the character set "\t\n\f\r\u0020\u2028\u2029" in JavaScript contexts that also contain actions may not be properly sanitized during execution.

Thanks to Juho Nurminen of Mattermost for reporting this issue.

This is CVE-2023-24540 and Go issue https://go.dev/issue/59721.

/cc @golang/security and @golang/release

Activity

  1. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Apr 21, 2023
  2. added this to the Go1.21 milestone 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: #59813 (for 1.19), #59814 (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/491355 mentions this issue: [release-branch.go1.19] html/template: handle all JS whitespace characters

  6. gopherbot commented on May 2, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/491356 mentions this issue: [release-branch.go1.20] html/template: handle all JS whitespace characters

  7. changed the title [-]security: fix CVE-2023-24540[/-] [+]html/template: improper handling of JavaScript whitespace[/+] on May 2, 2023
  8. gopherbot commented on May 2, 2023

    @gopherbot
    Contributor

    Change https://go.dev/cl/491616 mentions this issue: html/template: handle all JS whitespace characters

  9. added a commit that references this issue on Apr 29, 2024
    a32232c
  10. 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