Vulnerability · Published May 11, 2023 · Assigned by Go

CVE-2023-24540Improper handling of JavaScript whitespace in html/template

Critical 9.8

In plain English

A critical-severity command injection in html/template from Go standard library. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.6% (higher than 75% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.8Critical
Exploit odds (30 days)1.6%top 24.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

Not all valid JavaScript whitespace characters are 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:8aardvark-dns2:1.0.1-38.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8aardvark-dns2:1.7.0-1.module_el8.9.0+3657+d86e192fALSA-2023:6939
AlmaLinux:8buildah1:1.31.3-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8buildah1:1.24.6-7.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9buildah1:1.31.3-1.el9ALSA-2023:6473
AlmaLinux:8buildah-tests1:1.24.6-7.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8buildah-tests1:1.31.3-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:9buildah-tests1:1.31.3-1.el9ALSA-2023:6473
AlmaLinux:8cockpit-podman46-1.module_el8.7.0+3344+5bcd850fALSA-2023:6938
AlmaLinux:8cockpit-podman75-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8conmon3:2.1.8-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8conmon2:2.1.4-2.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8container-selinux2:2.205.0-3.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8container-selinux2:2.221.0-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8containernetworking-plugins1:1.1.1-5.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8containernetworking-plugins1:1.3.0-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:9containernetworking-plugins1:1.3.0-4.el9ALSA-2023:6402
AlmaLinux:8containers-common2:1-38.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8containers-common2:1-54.module_el8.9.0+3673+0c64b403ALSA-2023:6939
AlmaLinux:8crit3.15-3.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8crit3.15-3.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8crit3.18-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8criu3.18-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8criu3.15-3.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8criu3.15-3.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8criu-devel3.15-3.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8criu-devel3.18-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8criu-devel3.15-3.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8criu-libs3.15-3.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8criu-libs3.18-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8criu-libs3.15-3.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8crun1.8.7-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8crun1.8.3-1.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8delve1.9.1-1.module_el8.8.0+3471+a62632a0ALSA-2023:3319
AlmaLinux:8fuse-overlayfs1.9-2.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8fuse-overlayfs1.12-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8go-toolset1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9go-toolset1.19.9-1.el9_2ALSA-2023:3318
AlmaLinux:8golang1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8golang-bin1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang-bin1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8golang-docs1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang-docs1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8golang-misc1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang-misc1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8golang-race1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang-race1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8golang-src1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang-src1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8golang-tests1.19.9-1.module_el8.8.0+3570+5dc5ffc3ALSA-2023:3319
AlmaLinux:9golang-tests1.19.9-2.el9_2ALSA-2023:3318
AlmaLinux:8libslirp4.4.0-1.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8libslirp4.4.0-1.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8libslirp4.4.0-1.module_el8.8.0+3615+3543c705ALSA-2023:6939
AlmaLinux:8libslirp-devel4.4.0-1.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8libslirp-devel4.4.0-1.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8libslirp-devel4.4.0-1.module_el8.8.0+3615+3543c705ALSA-2023:6939
AlmaLinux:8netavark2:1.0.1-38.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8netavark2:1.7.0-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8oci-seccomp-bpf-hook1.2.9-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8oci-seccomp-bpf-hook1.2.5-2.module_el8.8.0+3468+16b86c82ALSA-2023:6938
AlmaLinux:8podman2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8podman3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:9podman2:4.6.1-5.el9ALSA-2023:6474
AlmaLinux:8podman-catatonit2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8podman-catatonit3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8podman-docker3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8podman-docker2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9podman-docker2:4.6.1-5.el9ALSA-2023:6474
AlmaLinux:8podman-gvproxy2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8podman-gvproxy3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:9podman-gvproxy2:4.6.1-5.el9ALSA-2023:6474
AlmaLinux:8podman-plugins3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8podman-plugins2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9podman-plugins2:4.6.1-5.el9ALSA-2023:6474
AlmaLinux:8podman-remote2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8podman-remote3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:9podman-remote2:4.6.1-5.el9ALSA-2023:6474
AlmaLinux:8podman-tests2:4.0.2-24.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8podman-tests3:4.6.1-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:9podman-tests2:4.6.1-5.el9ALSA-2023:6474
AlmaLinux:8python3-criu3.15-3.module_el8.6.0+3137+d33c3efbALSA-2023:6938
AlmaLinux:8python3-criu3.18-4.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8python3-criu3.15-3.module_el8.6.0+2877+8e437bf5ALSA-2023:6938
AlmaLinux:8python3-podman4.6.0-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8python3-podman4.0.0-2.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8runc1:1.1.5-2.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8runc1:1.1.9-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8skopeo2:1.13.3-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8skopeo2:1.6.2-8.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9skopeo2:1.13.3-1.el9ALSA-2023:6363
AlmaLinux:8skopeo-tests2:1.13.3-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8skopeo-tests2:1.6.2-8.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9skopeo-tests2:1.13.3-1.el9ALSA-2023:6363
AlmaLinux:8slirp4netns1.2.1-1.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8slirp4netns1.1.8-3.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:8toolbox0.0.99.4-5.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8toolbox0.0.99.4-5.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9toolbox0.0.99.4-6.el9_3ALSA-2023:6346
AlmaLinux:8toolbox-tests0.0.99.4-5.module_el8.9.0+3643+9234dc3bALSA-2023:6939
AlmaLinux:8toolbox-tests0.0.99.4-5.module_el8.9.0+3627+db8ec155ALSA-2023:6938
AlmaLinux:9toolbox-tests0.0.99.4-6.el9_3ALSA-2023:6346
AlmaLinux:8udica0.2.6-20.module_el8.8.0+3615+3543c705ALSA-2023:6939
AlmaLinux:8udica0.2.6-4.module_el8.9.0+3627+db8ec155ALSA-2023:6938
Alpine:v3.20go1.20.4-r0ALPINE-CVE-2023-24540
Alpine:v3.21go1.20.4-r0ALPINE-CVE-2023-24540
Alpine:v3.22go1.20.4-r0ALPINE-CVE-2023-24540
Alpine:v3.23go1.20.4-r0ALPINE-CVE-2023-24540
Alpine:v3.24go1.20.4-r0ALPINE-CVE-2023-24540
Debian:12golang-1.19no fix listedDEBIAN-CVE-2023-24540
Gostdlib1.19.9, 1.20.4GO-2023-1752
Rocky Linux:8buildah1:1.24.6-7.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8cockpit-podman0:46-1.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8conmon2:2.1.4-2.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8container-selinux2:2.205.0-3.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8containernetworking-plugins1:1.1.1-5.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8containers-common2:1-38.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8criu0:3.15-3.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8crun0:1.8.3-1.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8delve0:1.9.1-1.module+el8.8.0+1263+19d1a562RLSA-2023:3319
Rocky Linux:8fuse-overlayfs0:1.9-2.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8go-toolset0:1.19.9-1.module+el8.8.0+1298+7af20600RLSA-2023:3319
Rocky Linux:8golang0:1.19.9-1.module+el8.8.0+1298+7af20600RLSA-2023:3319
Rocky Linux:8libslirp0:4.4.0-1.module+el8.9.0+1445+07728297RLSA-2023:6939
Rocky Linux:8libslirp0:4.4.0-1.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8oci-seccomp-bpf-hook0:1.2.5-2.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8podman2:4.0.2-24.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8python-podman0:4.0.0-2.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8runc1:1.1.5-2.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8slirp4netns0:1.1.8-3.module+el8.9.0+1445+07728297RLSA-2023:6938
Rocky Linux:8udica0:0.2.6-4.module+el8.9.0+1445+07728297RLSA-2023:6938
Ubuntu:22.04:LTSgolang-1.201.20.3-1ubuntu0.1~22.04UBUNTU-CVE-2023-24540

Affected products (as reported)

VendorProductVersions
Go standard library html/template 0 – before 1.19.91.20.0-0 – before 1.20.4

Weakness: CWE-77 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

References