-
-
Notifications
You must be signed in to change notification settings - Fork 192
Bug: /tx/pending endpoint lacks maximum limit, memory DoS risk #1999
Copy link
Copy link
Open
Labels
securitySecurity-related changeSecurity-related change
Description
Severity: Low (5 RTC)
Description
list_pending in node/rustchain_tx_handler.py accepts a limit query parameter (default 100) and forwards it to tx_pool.get_pending_transactions(limit) without an upper bound. If a client requests a very large limit, the node may attempt to serialize and transmit a huge number of pending transactions, consuming memory and CPU.
Code
@app.route('/tx/pending', methods=['GET'])
def list_pending():
try:
limit = request.args.get('limit', 100, type=int)
pending = tx_pool.get_pending_transactions(limit)
return jsonify({"count": len(pending), "transactions": [...]})Fix
Cap the limit to a reasonable maximum (e.g., 200). Return 400 if exceeded.
Bug report for bounty #305. Wallet: RTC3fcd93a4ec68cfd6b59d1b41c4872c5c239c4ad8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
securitySecurity-related changeSecurity-related change