☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2024-39305

CVE-2024-39305 Use After Free in Envoy
📅 PUBLISHED: 2024-07-01 21:10 UTC 🔄 UPDATED: 2026-09-23 20:25 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm 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.65%
👁️
0.65% probability
16.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
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
6.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-39305 is a use-after-free vulnerability in Envoy, a cloud-native edge and service proxy. The flaw occurs when a route hash policy is configured with cookie attributes. During configuration parsing, memory allocated for holding attribute values is freed prematurely. When a request is processed, Envoy attempts to copy content from this de-allocated memory into the request cookie header, leading to potential information disclosure (arbitrary memory content sent to upstream services) or abnormal process termination (denial of service). The vulnerability has a CVSS score of 6.5 (Medium) and affects Envoy versions prior to 1.30.4, 1.29.7, 1.28.5, and 1.27.7. Patches are available, and a workaround is to avoid using cookie attributes in route action hash policy.

⚡ 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

Envoy is a critical component in many cloud-native environments, often deployed as a sidecar proxy in service meshes (e.g., Istio). A use-after-free vulnerability in Envoy can compromise the confidentiality and availability of the entire service mesh. Organizations using Envoy should prioritize patching to prevent potential data leaks or service disruptions.

CVSS Breakdown & Threat Level

  • CVSS Score: 6.5 (Medium)
  • Attack Vector (AV): Network (N)
  • Attack Complexity (AC): Low (L)
  • Privileges Required (PR): None (N)
  • User Interaction (UI): None (N)
  • Scope (S): Unchanged (U)
  • Confidentiality (C): Low (L)
  • Integrity (I): None (N)
  • Availability (A): Low (L)

The vulnerability is remotely exploitable without authentication, but it requires a specific configuration (cookie attributes in route hash policy). The impact is limited to information disclosure and potential denial of service.

Deep Dive & Mechanics

The vulnerability resides in Envoy's route hash policy implementation, specifically when cookie attributes are used. During configuration parsing, Envoy allocates memory to store attribute values (e.g., cookie name, path, domain). However, after parsing is complete, this memory is freed prematurely. When a subsequent request matches the route, Envoy attempts to read from the freed memory to construct the cookie header for upstream forwarding. This results in a use-after-free condition.

The freed memory may contain sensitive data from other parts of Envoy's heap, or it may have been reallocated for other purposes. This can lead to:

  • Information Disclosure: Arbitrary memory contents (including secrets, tokens, or other sensitive data) are sent to upstream services in the cookie header.
  • Denial of Service: If the freed memory is unmapped or corrupted, Envoy may crash (abnormal process termination).

The vulnerability is triggered only when a route hash policy is configured with cookie attributes. Without this specific configuration, the vulnerable code path is not executed.

Vulnerable vs. Patched Code

Vulnerable Code (simplified):

// During configuration parsing
std::string* cookie_attributes = new std::string(config.attributes());
// ... parse and use cookie_attributes ...
delete cookie_attributes; // Memory freed prematurely

// During request processing
Http::HeaderMap& headers = request.headers();
headers.addReferenceKey(Http::Headers::get().Cookie, *cookie_attributes); // Use-after-free

Patched Code (simplified):

// During configuration parsing
std::string cookie_attributes = config.attributes(); // Stored as value, not pointer
// ... parse and use cookie_attributes ...

// During request processing
Http::HeaderMap& headers = request.headers();
headers.addReferenceKey(Http::Headers::get().Cookie, cookie_attributes); // Safe access

The fix involves storing the cookie attributes as a value (not a dynamically allocated pointer) or extending their lifetime until after request processing. The patch ensures that the memory remains valid when accessed.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • An Envoy instance running a vulnerable version (e.g., 1.27.6).
  • A route configuration that includes a hash policy with cookie attributes.

Exploitation Steps:

  1. Identify an Envoy proxy with a route that uses cookie-based hash policy.
  2. Send a crafted request that triggers the vulnerable code path.
  3. Observe the response or upstream behavior to extract leaked memory.

Example Request:

GET / HTTP/1.1
Host: vulnerable-envoy.example.com
Cookie: session=abc123

Expected Outcome:

  • The upstream service may receive a cookie header containing leaked memory data.
  • Envoy may crash, causing a denial of service.

Note: No public exploit code is available for this vulnerability.

Blue Team (Detection & Defense)

Detection:

  • Monitor Envoy logs for crashes or unexpected behavior.
  • Use memory analysis tools to detect use-after-free patterns.
  • Implement network monitoring for anomalous cookie headers.

Defense:

  • Apply the patch immediately.
  • As a workaround, remove cookie attributes from route hash policy configurations.
  • Restrict network access to Envoy's management interface.

Indicators of Compromise (IOCs)

  • Network: Upstream services receiving cookie headers with unexpected or binary data.
  • Logs: Envoy crash logs indicating segmentation faults or memory corruption.
  • Memory: Heap dumps showing freed memory being accessed.

Example IOC (Log Entry):

[2024-06-01 12:34:56.789][12345][critical][assert] assert failure: use-after-free in route_hash_policy.cc:42

Detection Engineering

YARA Rule

rule CVE_2024_39305_Envoy_UseAfterFree {
    meta:
        description = "Detects Envoy binary with use-after-free vulnerability in route hash policy"
        author = "Valters IT"
        date = "2024-06-01"
        reference = "CVE-2024-39305"
    strings:
        $s1 = "cookie_attributes" ascii wide nocase
        $s2 = "delete" ascii wide nocase
        $s3 = "addReferenceKey" ascii wide nocase
    condition:
        all of them
}

Sigma Rule

title: CVE-2024-39305 Envoy Use-After-Free Detection
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential exploitation of CVE-2024-39305 in Envoy logs
author: Valters IT
date: 2024-06-01
logsource:
    category: application
    product: envoy
detection:
    selection:
        - "assert failure: use-after-free"
        - "segmentation fault"
        - "memory corruption"
    condition: selection
falsepositives:
    - Legitimate crashes due to other bugs
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-39305 Envoy Use-After-Free Exploit Attempt"; flow:to_server; content:"Cookie"; http_header; pcre:"/Cookie:\s*[^\r\n]{100,}/Ri"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Envoy to versions v1.30.4, v1.29.7, v1.28.5, or v1.27.7.
  2. If upgrading is not possible, remove cookie attributes from all route hash policy configurations.

Long-term Measures:

  • Implement memory safety checks in CI/CD pipelines.
  • Regularly update Envoy to the latest stable version.
  • Monitor Envoy security advisories.

Workaround:

  • Do not use cookie attributes in route action hash policy.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-39305/ · 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.