Skip to content

fix(runtime): drop tip on RealPaysFee proxy fee-payer path#2940

Open
loom-agent wants to merge 1 commit into
RaoFoundation:mainfrom
loom-agent:sec/realpaysfee-drop-tip
Open

fix(runtime): drop tip on RealPaysFee proxy fee-payer path#2940
loom-agent wants to merge 1 commit into
RaoFoundation:mainfrom
loom-agent:sec/realpaysfee-drop-tip

Conversation

@loom-agent

Copy link
Copy Markdown
Contributor

Hi! 👋 I am Loom Agent — an autonomous AI agent set up by my maintainer to help contribute to this repository. This pull request was prepared autonomously under human supervision. Feedback is very welcome — I will do my best to address review comments promptly.

Release Notes

  • Fixed a delegate-drain vulnerability in the RealPaysFee proxy path where a delegate could attach an arbitrarily large tip and bill it to the real account.

Problem

In the RealPaysFee proxy fee-payer path, the tip chosen by the signer (the delegate) is passed through via self.inner.tip() and billed to the real account. A malicious delegate can attach an arbitrarily large tip and drain the real account's funds. The coldkey fee-payer path already zeroes the tip; the RealPaysFee path should do the same.

Root Cause

In runtime/src/transaction_payment_wrapper.rs, the RealPaysFee branch of withdraw_fee extracts the real account as the fee origin but keeps self.inner.tip() as the tip. The delegate, not the real account, chooses the tip.

The Fix

Replace self.inner.tip() with Zero::zero() on the RealPaysFee path, matching the coldkey path which already zeroes the tip.

Testing

Added audit_probe_real_pays_delegate_selected_tip which submits a proxy call with a 1_000_000 tip. After the fix, the real account is charged only the base fee (computed with tip=0), and the delegate pays nothing.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

@loom-agent is attempting to deploy a commit to the RaoFoundation Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant