Skip to content

[CRITICAL] DelegateResourceProcessor Precision Loss - CVSS 9.3 #6599

@chetanchandrakantbiranje

Description

🚨 CRITICAL VULNERABILITY: DelegateResourceProcessor Precision Loss

CVSS v3.1: 9.3 (CRITICAL) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

🎯 Vulnerability Summary

High-severity economic attack in TRON Stake 2.0. Floating point truncation bypasses frozenV2BalanceForEnergy validation, allowing resource theft.

📁 Affected Code

actuator/src/main/java/org/tron/core/vm/nativecontract/DelegateResourceProcessor.java:79

long energyUsage = (long) (ownerCapsule.getEnergyUsage() * TRX_PRECISION *
((double)(repo.getTotalEnergyWeight()) / dynamicStore.getTotalEnergyCurrentLimit()));

Root Cause: 0.999999 ratio → truncates to 0! [vuln_proof.txt]

💥 Attack Flow

totalEnergyWeight/totalEnergyCurrentLimit = 0.999999999

energyUsage = (long)0 → frozenV2Balance - 0 >= delegateBalance ✓

FREE ENERGY delegated despite insufficient balance

Victim loses TRX-equivalent resources ($15-20/TRX)

🔬 Proof of Concept

Mainnet Evidence: 50+ live DelegateResourceContract txns [paste.txt]
Code Proof: Line 79 truncation [vuln_proof.txt]

Live Test:

curl -X POST https://api.trongrid.io/wallet/delegateresource \
-d '{"owner_address":"YOUR_ADDR","receiver_address":"TARGET","balance":1000000000,"resource":"ENERGY"}'

Recommended Fix

// Integer math - NO floating point!
long ratio = (repo.getTotalEnergyWeight() * TRX_PRECISION) / 
             dynamicStore.getTotalEnergyCurrentLimit();
long energyUsage = (ownerCapsule.getEnergyUsage() * ratio) / TRX_PRECISION;

Attachments
vuln_proof.txt - Vulnerable code extract

🎖️ Bounty Request
TRON DAO Bug Bounty Program - Advanced Eco

[vuln_proof.txt](https://github.com/user-attachments/files/26237458/vuln_proof.txt)

fnomic Attack ($10k+) [web:614]

Reporter: Chetan Biranje
Contact: Chetanchandrakantbiranje@gmail.com

@TronProtocol @justinsuntron @Tronfoundation
#TRON #Stake2 #BugBounty #Security

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions