Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-104635 Overview
CVE-2026-104635 is an uncontrolled recursion vulnerability [CWE-674] in the elixir-protobuf library's JSON decoder. The flaw resides in Protobuf.JSON.Decode and allows an unauthenticated remote attacker to crash the decoding process by supplying a deeply nested JSON document. Any application that decodes attacker-controlled JSON with Protobuf.JSON.decode/3, Protobuf.JSON.decode!/3, or Protobuf.JSON.from_decoded/3 into a schema containing a self-referential or cyclic message type is affected. The issue impacts protobuf versions from 0.8.0 up to, but not including, 0.17.1.
Critical Impact
Remote attackers can exhaust decoder memory and crash Elixir processes handling untrusted JSON, producing a denial-of-service condition. Confidentiality and integrity are not affected.
Affected Products
- elixir-protobuf/protobuf versions 0.8.0 through 0.17.0
- Elixir applications decoding untrusted JSON into user-defined protobuf message types
- Services relying on schemas with self-referential or cyclic message definitions
Discovery Timeline
- 2026-10-09 - CVE-2026-104635 published to NVD
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2026-104635
Vulnerability Analysis
The elixir-protobuf library converts JSON documents into protobuf message structs. During decoding, each nested embedded message triggers a recursive call. The decoder does not increment or check its depth counter for user-defined message types, so attacker-controlled nesting can grow without bound.
An attacker who can submit JSON to an endpoint using Protobuf.JSON.decode/3 with a schema containing a self-referential message type can trigger stack and heap growth per nesting level. A sufficiently deep document exhausts the memory of the decoding BEAM process and crashes it, resulting in a denial-of-service condition. The attack requires no authentication and no user interaction.
Root Cause
In lib/protobuf/json/decode.ex, the embedded-message clause of decode_singular/3 recurses into internal_from_json_data/3 without calling the depth guard. The guard function increase_depth_and_maybe_throw/1 only covers the Google.Protobuf.ListValue and Google.Protobuf.Struct clauses. As a result, the documented :recursion_limit option has no effect on user-defined message types, leaving cyclic schemas unbounded.
Attack Vector
Exploitation requires only network access to an HTTP, gRPC-gateway, or message-queue endpoint that forwards JSON payloads into the vulnerable decoder. The attacker submits a document with thousands of nested objects matching a recursive field. Each level allocates a new stack frame and heap objects until the process runs out of memory and terminates.
# Patch excerpt from lib/protobuf/json/decode.ex
# Default recursion limit, matching upstream Protobuf
# (ParseOptions::recursion_depth in C++, .recursion_limit in Java/Go).
- # Applies to the dynamically-typed wrappers (Value/ListValue/Struct) where
- # nesting is bounded only by the input, not the schema.
+ # Counts ordinary messages, Any, Struct and ListValue. Value dispatch and
+ # conversion from Object to map do not add a level.
@default_recursion_limit 100
Source: GitHub Commit e9432ad
Detection Methods for CVE-2026-104635
Indicators of Compromise
- Elixir/BEAM VM process crashes or restarts correlated with inbound JSON requests
- Unusually large request bodies containing repetitive nested object structures matching a recursive protobuf field
- Sudden memory growth followed by :system_limit or out-of-memory errors in application logs
- Protobuf.JSON.DecodeError entries alongside process-exit telemetry
Detection Strategies
- Audit application dependencies for protobuf versions in the range 0.8.0 to 0.17.0 using mix deps or SBOM tooling
- Inspect .proto schemas for self-referential or cyclic message definitions decoded from JSON input
- Instrument the decode path to log request size and nesting depth before invoking Protobuf.JSON.decode/3
Monitoring Recommendations
- Track BEAM scheduler memory metrics and alert on sudden allocations from JSON parsing supervisors
- Monitor HTTP ingress for JSON payloads exceeding expected size or nesting thresholds
- Correlate decoder error rates with upstream client identifiers to identify abusive sources
How to Mitigate CVE-2026-104635
Immediate Actions Required
- Upgrade protobuf to version 0.17.1 or later in all Elixir applications
- Place a size and depth limit on JSON payloads at the ingress tier (reverse proxy, API gateway, or Plug)
- Restrict decoding of untrusted JSON to schemas without recursive message types where feasible
- Review authentication requirements on endpoints that accept JSON for protobuf decoding
Patch Information
The fix is included in elixir-protobuf/protobuf 0.17.1. The patched decoder counts ordinary messages, Google.Protobuf.Any, Google.Protobuf.Struct, and Google.Protobuf.ListValue toward the depth budget, so the :recursion_limit option now bounds user-defined message types. Review the GitHub Security Advisory GHSA-m497-c2h9-rvw6, the CNA entry, and the OSV record for complete details.
Workarounds
- Enforce a maximum request body size at the web server or load balancer
- Pre-validate JSON depth using a lightweight parser before handing input to Protobuf.JSON.decode/3
- Isolate decoding in a supervised worker process so crashes do not propagate to the parent service
- Lower the :recursion_limit option after upgrading to 0.17.1 to match application needs
# Update the dependency in mix.exs and fetch
# {:protobuf, "~> 0.17.1"}
mix deps.update protobuf
mix deps.get
mix compile --force
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

