☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 8.4 🐛 CWE-416
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-27934

CVE-2024-27934 Use After Free in Deno
📅 PUBLISHED: 2024-03-06 20:56 UTC 🔄 UPDATED: 2026-10-11 18:45 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.39%
👁️
0.39% probability
9.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-27934 is a critical use-after-free vulnerability in the Deno JavaScript, TypeScript, and WebAssembly runtime, affecting versions 1.36.2 through 1.40.2. The flaw resides in the unsafe handling of *const c_void and ExternalPointer types, which can be exploited by an attacker controlling code executed within the Deno runtime to achieve arbitrary code execution on the host machine, bypassing all sandbox permissions. The vulnerability has a CVSS score of 8.4, indicating high severity. The official patch was released in Deno version 1.40.3.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Deno is a modern runtime for JavaScript, TypeScript, and WebAssembly, often used in server-side applications and tooling. This vulnerability is particularly dangerous in supply chain contexts because an attacker who can inject malicious code into a Deno application (e.g., via a compromised dependency or user input) can escape the runtime sandbox and execute arbitrary code on the host. Organizations using Deno in CI/CD pipelines, serverless functions, or microservices should treat this as a critical supply chain risk.

CVSS Breakdown & Threat Level

  • CVSS Score: 8.4 (High)
  • Attack Vector: Local (AV:L) – The attacker must be able to execute code within the Deno runtime.
  • Attack Complexity: Low (AC:L) – The exploitation does not require special conditions.
  • Privileges Required: None (PR:N) – No prior authentication needed.
  • User Interaction: None (UI:N) – No user action required beyond running the malicious code.
  • Scope: Changed (S:C) – The vulnerability can impact resources beyond the original security scope.
  • Confidentiality Impact: High (C:H) – Full system compromise possible.
  • Integrity Impact: High (I:H) – Arbitrary code execution allows modification of system state.
  • Availability Impact: High (A:H) – Can lead to denial of service or full system takeover.

Threat Level: Critical. The ability to escape the Deno sandbox and execute arbitrary code on the host machine makes this a severe threat, especially in environments where untrusted code is executed.

Deep Dive & Mechanics

The vulnerability stems from the use of inherently unsafe *const c_void and ExternalPointer types in Deno's FFI (Foreign Function Interface) and low-level memory management. These types are used to represent raw pointers to external memory, but improper lifecycle management leads to a use-after-free condition.

Root Cause:

  • When an ExternalPointer or *const c_void is created, it points to a memory region that may be freed or reallocated by the runtime.
  • If the pointer is accessed after the underlying memory has been freed, the runtime may read or write to memory that is now controlled by an attacker.
  • This can be triggered by carefully crafted JavaScript or TypeScript code that manipulates these pointers, causing the runtime to dereference a dangling pointer.

Exploitation Mechanism:

  1. An attacker creates an ExternalPointer pointing to a controlled memory region.
  2. The attacker triggers a garbage collection or explicit free of the underlying memory.
  3. The attacker then accesses the pointer again, causing the runtime to read or write to the freed memory.
  4. By controlling the freed memory (e.g., via heap spraying), the attacker can achieve arbitrary code execution.

Impact: Full sandbox escape, leading to arbitrary code execution on the host machine with the privileges of the Deno process.

Vulnerable vs. Patched Code

Vulnerable Code (Deno < 1.40.3):

// Example of unsafe pointer usage in Deno's FFI
let ptr: *const c_void = ...; // ExternalPointer or raw pointer
// Memory is freed elsewhere
unsafe {
    // Use-after-free: ptr now points to freed memory
    let value = *(ptr as *const u32);
}

Patched Code (Deno >= 1.40.3):

// Patched version with proper lifetime management
let ptr: *const c_void = ...;
// Ensure the memory is not freed while the pointer is in use
let guard = MemoryGuard::new(ptr);
unsafe {
    // Safe access under guard
    let value = *(ptr as *const u32);
}
// Memory is freed only after guard is dropped

The patch introduces a MemoryGuard mechanism that ensures the underlying memory is not freed while any ExternalPointer or *const c_void reference exists. This prevents the use-after-free condition.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • Deno runtime version 1.36.2 to 1.40.2.
  • Ability to execute arbitrary JavaScript/TypeScript code within the runtime.

Exploitation Steps:

  1. Create a malicious script that exploits the use-after-free vulnerability.
  2. Use heap spraying to control the freed memory.
  3. Trigger the use-after-free to achieve arbitrary code execution.

Example Exploit Skeleton:

// exploit.js
const ffi = Deno.dlopen("libc.so.6", {
    "malloc": { parameters: ["usize"], result: "pointer" },
    "free": { parameters: ["pointer"], result: "void" },
});

// Allocate memory
let ptr = ffi.symbols.malloc(1024);
// Write controlled data
let view = new Uint8Array(Deno.UnsafePointerView.getArrayBuffer(ptr, 1024));
view.fill(0x41);

// Free the memory
ffi.symbols.free(ptr);

// Use-after-free: access the freed memory
// This may read or write to attacker-controlled memory
let value = Deno.UnsafePointerView.getUint32(ptr);

Note: This is a simplified example. Actual exploitation requires careful heap manipulation and may vary by platform.

Blue Team (Defense)

Detection:

  • Monitor for unusual Deno process behavior, such as unexpected memory access patterns.
  • Use runtime monitoring tools to detect use-after-free conditions.
  • Enable Deno's built-in security features (e.g., --allow-ffi restrictions).

Mitigation:

  • Immediately upgrade to Deno version 1.40.3 or later.
  • Restrict the use of --allow-ffi and --allow-run permissions in production.
  • Implement strict input validation and code review for any code that uses Deno's FFI.

Indicators of Compromise (IOCs)

  • File Hashes:
    • Malicious Deno scripts exploiting this vulnerability may have specific hash values (to be determined based on actual exploits).
  • Network Indicators:
    • Outbound connections from Deno processes to unexpected IPs or domains (post-exploitation C2).
  • Process Indicators:
    • Deno processes with abnormal memory usage or crashes.
    • Child processes spawned by Deno without explicit --allow-run permissions.
  • Registry/File System:
    • Unusual files created in temporary directories by Deno processes.

Detection Engineering

YARA Rule

rule CVE_2024_27934_Deno_UseAfterFree {
    meta:
        description = "Detects potential exploitation of CVE-2024-27934 in Deno scripts"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-27934"
    strings:
        $s1 = "ExternalPointer" nocase
        $s2 = "*const c_void" nocase
        $s3 = "Deno.UnsafePointerView" nocase
        $s4 = "malloc" nocase
        $s5 = "free" nocase
    condition:
        all of ($s1, $s2, $s3) or (all of ($s3, $s4, $s5))
}

Sigma Rule

title: CVE-2024-27934 Deno Use-After-Free Exploitation
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential exploitation of CVE-2024-27934 in Deno runtime
author: Valters IT
date: 2024-01-01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-27934
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\deno.exe'
        CommandLine|contains:
            - '--allow-ffi'
            - '--allow-run'
    condition: selection
falsepositives:
    - Legitimate use of Deno FFI
level: high

Suricata Rule

alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-27934 Deno Use-After-Free Exploitation"; flow:to_server,established; content:"|2f|exploit|2e|js|3a|"; nocase; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Deno: Update to version 1.40.3 or later immediately.
  2. Restrict Permissions: Limit the use of --allow-ffi and --allow-run flags in production environments.
  3. Code Review: Review all code that uses Deno's FFI or UnsafePointerView for potential use-after-free patterns.

Long-Term Mitigations:

  • Implement runtime monitoring for memory corruption.
  • Use Deno's built-in sandboxing features to isolate untrusted code.
  • Regularly update Deno to the latest stable version.

Workarounds:

  • If upgrading is not immediately possible, avoid using ExternalPointer and *const c_void in untrusted code.
  • Use Deno's --no-remote flag to prevent loading remote modules that may contain exploits.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-27934/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.