[SECURITY] GPU escrow create_escrow accepts arbitrary from_wallet without ownership verification

Open
#8,179 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 10 days

Nobody has claimed this yet.

  • #8183 by @shiyaam-s07 — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
24/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
blockchain, cryptography, flask, python

Research direction

Start by reading gpu_render_protocol.py, especially create_escrow (around L11635–L12987) and the Flask escrow routes (L618–L680); trace how wallet ownership and the escrow secret are handled. Review the linked pull request #8183 and the issue discussion before making changes. Done means escrow creation verifies control of from_wallet and does not expose the secret in the response, with tests covering the reported attack flow.

Written by the indexing model from the issue text.

Description

stale

Finding

Location: gpu_render_protocol.py L11479-13091, Flask routes at L618-656

Issue: The /render/escrow, /voice/escrow, /llm/escrow POST endpoints accept from_wallet, to_wallet, and amount_rtc from the request body without verifying that the caller controls from_wallet. The create_escrow function:

  1. Takes from_wallet as a plain string (L11635)
  2. Generates an escrow_secret (L12114)
  3. Inserts a record into render_escrow with status='locked' (L12205)
  4. Returns the escrow_secret directly in the response (L12987)

The release_escrow endpoint (L658-680) requires actor_wallet matching from_wallet AND the escrow_secret. But since the attacker set from_wallet themselves and received the secret from create_escrow, they know both values.

Attack Flow:

  1. POST /render/escrow with {"from_wallet": "victim_wallet", "to_wallet": "attacker_wallet", "amount_rtc": 100}
  2. Server creates escrow record and returns escrow_secret in response
  3. POST /render/release with {"job_id": "<returned_id>", "actor_wallet": "victim_wallet", "escrow_secret": "<returned_secret>"}
  4. Escrow released — RTC credited to attacker_wallet

Impact: If the escrow system is connected to actual RTC balances, an attacker can drain any wallet's funds by creating escrows on their behalf and releasing to themselves. Even if escrow is a separate ledger, the attacker can create fake locked escrows that may block victim's funds or affect reward calculations.

Fix: create_escrow must verify that the caller controls from_wallet via Ed25519 signature or wallet ownership proof. The escrow_secret should NOT be returned in the API response — it should be sent to from_wallet out-of-band or derived from a shared secret.


Wallet: leanworld7
Severity: HIGH
References: bounty #1102

Dominant language
Python
Stars
850
Forks
589
Avg merge
11d 7h
Merged PRs (30d)
29

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Scottcjn/Rustchain

All issues in Scottcjn/Rustchain

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.