CVE-2025-59789: CWE-674 Uncontrolled Recursion in Apache Software Foundation Apache bRPC
Uncontrolled recursion in the json2pb component in Apache bRPC (version < 1.15.0) on all platforms allows remote attackers to make the server crash via sending deep recursive json data. Root Cause: The bRPC json2pb component uses rapidjson to parse json data from the network. The rapidjson parser uses a recursive parsing method by default. If the input json has a large depth of recursive structure, the parser function may run into stack overflow. Affected Scenarios: Use bRPC server with protobuf message to serve http+json requests from untrusted network. Or directly use JsonToProtoMessage to convert json from untrusted input. How to Fix: (Choose one of the following options) 1. Upgrade bRPC to version 1.15.0, which fixes this issue. 2. Apply this patch: https://github.com/apache/brpc/pull/3099 Note: No matter which option you choose, you should know that the fix introduces a recursion depth limit with default value 100. It affects these functions: ProtoMessageToJson, ProtoMessageToProtoJson, JsonToProtoMessage, and ProtoJsonToProtoMessage. If your requests contain json or protobuf messages that have a depth exceeding the limit, the request will be failed after applying the fix. You can modify the gflag json2pb_max_recursion_depth to change the limit.
AI Analysis
Technical Summary
CVE-2025-59789 is a vulnerability in the Apache bRPC framework's json2pb component, specifically in versions before 1.15.0. The root cause is the use of the rapidjson parser's default recursive parsing method, which does not limit recursion depth. When processing JSON data with excessive nesting, this leads to uncontrolled recursion, causing stack overflow and ultimately crashing the server process. This vulnerability can be exploited remotely by attackers sending specially crafted HTTP+JSON requests containing deeply nested JSON structures to bRPC servers that use protobuf messages. The affected functions include ProtoMessageToJson, ProtoMessageToProtoJson, JsonToProtoMessage, and ProtoJsonToProtoMessage. The vulnerability does not require authentication or user interaction, making it easier to exploit. The fix, introduced in bRPC version 1.15.0 and available as a patch, enforces a recursion depth limit (default 100) to prevent stack overflow. This limit can be adjusted via the gflag json2pb_max_recursion_depth to balance security and functionality. However, requests with JSON or protobuf messages exceeding this depth will fail after applying the fix. No known exploits are currently reported in the wild, but the vulnerability's high CVSS score (7.5) reflects its potential impact on availability. This vulnerability is categorized under CWE-674 (Uncontrolled Recursion).
Potential Impact
For European organizations, the primary impact of CVE-2025-59789 is denial-of-service (DoS) due to server crashes triggered by maliciously crafted JSON payloads. Organizations using Apache bRPC in public-facing services or internal APIs that accept JSON input from untrusted networks are vulnerable. This can lead to service outages, affecting business continuity and potentially causing reputational damage. Critical sectors such as finance, telecommunications, and government services relying on bRPC for RPC communication may experience disruptions. The vulnerability does not compromise confidentiality or integrity directly but can be leveraged as part of a broader attack strategy to degrade service availability. Given the ease of remote exploitation without authentication, attackers can launch automated attacks at scale. The recursion depth limit introduced in the fix may also impact legitimate applications that use deeply nested JSON or protobuf messages, requiring careful configuration to avoid service disruptions.
Mitigation Recommendations
European organizations should prioritize upgrading Apache bRPC to version 1.15.0, which contains the official fix for this vulnerability. If immediate upgrade is not feasible, applying the patch from the Apache bRPC GitHub repository (PR #3099) is recommended. After applying the fix, review and adjust the gflag json2pb_max_recursion_depth to accommodate legitimate JSON/protobuf message depths without compromising security. Implement network-level protections such as web application firewalls (WAFs) and rate limiting to detect and block anomalous requests with excessively deep JSON structures. Monitor logs for repeated crashes or malformed JSON payloads indicative of exploitation attempts. Conduct thorough testing of applications using bRPC to identify any legitimate use cases of deep recursion that may be affected by the recursion depth limit and refactor them if necessary. Additionally, segment and isolate bRPC services to minimize the blast radius of potential DoS attacks. Maintain up-to-date threat intelligence feeds to detect emerging exploit attempts targeting this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy
CVE-2025-59789: CWE-674 Uncontrolled Recursion in Apache Software Foundation Apache bRPC
Description
Uncontrolled recursion in the json2pb component in Apache bRPC (version < 1.15.0) on all platforms allows remote attackers to make the server crash via sending deep recursive json data. Root Cause: The bRPC json2pb component uses rapidjson to parse json data from the network. The rapidjson parser uses a recursive parsing method by default. If the input json has a large depth of recursive structure, the parser function may run into stack overflow. Affected Scenarios: Use bRPC server with protobuf message to serve http+json requests from untrusted network. Or directly use JsonToProtoMessage to convert json from untrusted input. How to Fix: (Choose one of the following options) 1. Upgrade bRPC to version 1.15.0, which fixes this issue. 2. Apply this patch: https://github.com/apache/brpc/pull/3099 Note: No matter which option you choose, you should know that the fix introduces a recursion depth limit with default value 100. It affects these functions: ProtoMessageToJson, ProtoMessageToProtoJson, JsonToProtoMessage, and ProtoJsonToProtoMessage. If your requests contain json or protobuf messages that have a depth exceeding the limit, the request will be failed after applying the fix. You can modify the gflag json2pb_max_recursion_depth to change the limit.
AI-Powered Analysis
Technical Analysis
CVE-2025-59789 is a vulnerability in the Apache bRPC framework's json2pb component, specifically in versions before 1.15.0. The root cause is the use of the rapidjson parser's default recursive parsing method, which does not limit recursion depth. When processing JSON data with excessive nesting, this leads to uncontrolled recursion, causing stack overflow and ultimately crashing the server process. This vulnerability can be exploited remotely by attackers sending specially crafted HTTP+JSON requests containing deeply nested JSON structures to bRPC servers that use protobuf messages. The affected functions include ProtoMessageToJson, ProtoMessageToProtoJson, JsonToProtoMessage, and ProtoJsonToProtoMessage. The vulnerability does not require authentication or user interaction, making it easier to exploit. The fix, introduced in bRPC version 1.15.0 and available as a patch, enforces a recursion depth limit (default 100) to prevent stack overflow. This limit can be adjusted via the gflag json2pb_max_recursion_depth to balance security and functionality. However, requests with JSON or protobuf messages exceeding this depth will fail after applying the fix. No known exploits are currently reported in the wild, but the vulnerability's high CVSS score (7.5) reflects its potential impact on availability. This vulnerability is categorized under CWE-674 (Uncontrolled Recursion).
Potential Impact
For European organizations, the primary impact of CVE-2025-59789 is denial-of-service (DoS) due to server crashes triggered by maliciously crafted JSON payloads. Organizations using Apache bRPC in public-facing services or internal APIs that accept JSON input from untrusted networks are vulnerable. This can lead to service outages, affecting business continuity and potentially causing reputational damage. Critical sectors such as finance, telecommunications, and government services relying on bRPC for RPC communication may experience disruptions. The vulnerability does not compromise confidentiality or integrity directly but can be leveraged as part of a broader attack strategy to degrade service availability. Given the ease of remote exploitation without authentication, attackers can launch automated attacks at scale. The recursion depth limit introduced in the fix may also impact legitimate applications that use deeply nested JSON or protobuf messages, requiring careful configuration to avoid service disruptions.
Mitigation Recommendations
European organizations should prioritize upgrading Apache bRPC to version 1.15.0, which contains the official fix for this vulnerability. If immediate upgrade is not feasible, applying the patch from the Apache bRPC GitHub repository (PR #3099) is recommended. After applying the fix, review and adjust the gflag json2pb_max_recursion_depth to accommodate legitimate JSON/protobuf message depths without compromising security. Implement network-level protections such as web application firewalls (WAFs) and rate limiting to detect and block anomalous requests with excessively deep JSON structures. Monitor logs for repeated crashes or malformed JSON payloads indicative of exploitation attempts. Conduct thorough testing of applications using bRPC to identify any legitimate use cases of deep recursion that may be affected by the recursion depth limit and refactor them if necessary. Additionally, segment and isolate bRPC services to minimize the blast radius of potential DoS attacks. Maintain up-to-date threat intelligence feeds to detect emerging exploit attempts targeting this vulnerability.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- apache
- Date Reserved
- 2025-09-20T06:17:58.940Z
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 692d70a066fdaac17027827d
Added to database: 12/1/2025, 10:40:32 AM
Last enriched: 12/8/2025, 11:53:35 AM
Last updated: 1/15/2026, 2:58:27 PM
Views: 500
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-71019: n/a
UnknownCVE-2025-70744: n/a
UnknownCVE-2026-0992: Uncontrolled Resource Consumption in Red Hat Red Hat Enterprise Linux 10
LowCVE-2026-0990: Uncontrolled Recursion in Red Hat Red Hat Enterprise Linux 10
MediumCVE-2026-0989: Uncontrolled Recursion in Red Hat Red Hat Enterprise Linux 10
LowActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.