Potential Security Vulnerability in claim_unbond_public
Method - Unauthorized Claim and Incomplete Transaction Records
#2556
Labels
bug
Something isn't working
🐛 Bug Report
Summary
A potential security vulnerability has been identified and confirmed in the
credits.aleo
contract, specifically in theclaim_unbond_public
method. The current implementation lacks proper permission checks, allowing unauthorized addresses to claim unbonded funds and leading to incomplete transaction records.Description
The
claim_unbond_public
method'sfinalize
function currently only includes thestaker
address as a parameter, omitting thecaller
address. This implementation differs from other methods likeunbond
, where thecaller
address is passed to thefinalize
function, allowing explorers to capture this information.Current implementation:
This discrepancy creates several critical issues:
Lack of Permission Checking: Without the
caller
address, it's impossible to verify if the person initiating theclaim_unbond_public
is actually authorized to do so.Unauthorized Claim of Unbonded Funds: Any address can successfully call the
claim_unbond_public
function and claim unbonded funds for any staker.Incomplete Explorer Transaction Records: Aleo explorers cannot capture the full transaction details, specifically the caller and withdrawal addresses, making it difficult to track fund movements triggered by
claim_unbond_public
.Inconsistent Balance Changes: The withdrawal address receives funds without any corresponding transaction record, making it appear as if the balance increased out of thin air.
Steps to Reproduce
We have confirmed this vulnerability on the testnet with the following scenario:
aleo1uqv7a3gggcs4ktc5q7m65628mje9vha0qdya49ktudxj5qkjdsyq9dqrnv
aleo10knhj6n6pe769gnu3vuuq2x7pxqlkc38trkj2u3ezhc08u84yyrq5u9u47
aleo1yvx2sl4p85lj83lk27x856grunzeusk3wvqnych9p3tx0w6gtqqq5t7u6s
Steps to reproduce:
claim_unbond_public
function using the private key of the unrelated address.Results:
claim_unbond_public
execution record appeared in the staker's address history.Potential Impact
Suggested Fix
Modify the
claim_unbond_public
method to include both thecaller
andstaker
addresses in itsfinalize
function, and implement proper authorization checks.This change would allow for proper permission checking, ensuring that only the authorized withdrawal address can claim unbonded funds. It would also enable complete transaction recording, accurately reflecting fund movements in Aleo explorers.
Additional Notes
finalize
part of transitions, making this omission particularly problematic for transparency and security.Thank you for your time and dedication to maintaining the security and reliability of the Aleo ecosystem. If you need any clarification or additional information, please don't hesitate to reach out. I look forward to your response and am hopeful that together we can address this potential vulnerability.
The text was updated successfully, but these errors were encountered: