Uncontrolled Recursion Affecting protobuf package, versions >=0.8.0 <0.17.1


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.39% (31st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-HEX-PROTOBUF-20828185
  • published12 Oct 2026
  • disclosed9 Oct 2026
  • creditDaniel Coles

Introduced: 9 Oct 2026

NewCVE-2026-104635  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade protobuf to version 0.17.1 or higher.

Overview

protobuf is a pure Elixir implementation of Google Protobuf.

Affected versions of this package are vulnerable to Uncontrolled Recursion in Protobuf.JSON.Decode in lib/protobuf/json/decode.ex, whose decode_singular/3 embedded message clause, internal_from_json_data/3, decode_message/4, decode_regular_fields/3, and decode_value/3 descend through nested messages without calling increase_depth_and_maybe_throw/1, which runs only in the Google.Protobuf.ListValue and Google.Protobuf.Struct clauses. An attacker can exhaust the stack and memory and crash the process by sending one deeply nested JSON body to an endpoint that decodes it into a self-referential message type such as a tree node. This requires the application to decode attacker supplied JSON into a schema that references itself, the recursion_limit option does not constrain user defined types, and since max_heap_size defaults to unlimited the consumption from concurrent requests can reach the whole node rather than the one process.

Workaround

This vulnerability can be avoided by capping the accepted request body size and rejecting JSON past a maximum nesting depth at the web or middleware layer, before the decoder is reached.

CVSS Base Scores

version 4.0
version 3.1