Cyfrin_Hub.pay_holding_debt() credits excess ETH to company_balance without owner withdrawal path. When owner overpays, excess is permanently locked; race condition with _apply_holding_cost() forces overpayment.
Likelihood: Medium
Owners may overpay to ensure full debt coverage (avoiding partial payment scenario). No refund mechanism means any overpayment is permanently trapped.
Impact: High
Direct owner loss; excess ETH permanently locked; affects protocol capital management.
Overview: Python test test_poc_005_owner_debt_overpayment.py demonstrates owner losing ETH when overpaying holding debt. Time-based holding costs accumulate debt, owner overpays by 1 ETH, and excess is permanently trapped in company_balance.
Step-by-step:
Setup: Owner funds company with 5 ETH, produces 10 items, then fast-forwards 2000 hours to accumulate holding debt.
Attack Vector: Owner calls pay_holding_debt() with holding_debt + 1 ETH (intentional overpayment).
Execution Flow: Contract clears holding_debt to zero using the debt portion of payment, and credits the excess (1 ETH overpayment) to company_balance.
Result: Excess 1 ETH trapped in company_balance; owner has no shares and no withdrawal path to recover funds.
Refund excess payment to prevent owner ETH lock, or revert on overpayment to force exact amounts.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.