Normal behavior:
A contract that sends ETH to external addresses must protect against reentrancy by using a proven guard (non-reentrant modifier/lock) and by following checks→effects→interactions patterns.
Specific issue:
The top of the file contains the line # pragma nonreentrancy on, which is a comment and does not apply a reentrancy guard to any function. Key functions that send ETH (for example withdraw_shares() and parts of fund_investor() that may call raw_call for refunds) do not have an explicit non-reentrant decorator or lock applied. Because there is no effective reentrancy protection, a malicious contract investor can re-enter other state-changing functions during the external call and corrupt accounting or drain funds.
Likelihood:
Medium — attackers only need to deploy a malicious investor contract (trivial) to attempt reentrancy; many users are EOAs (lower chance), but a single malicious actor is sufficient.
Impact:
High — reentrancy during withdraw_shares() (or related flows) can:
Corrupt issued_shares / shares[...] accounting,
Allow double-spend or unauthorized share minting, or
Permit funds to be drained through carefully-timed nested calls.
Outcome: severe financial loss and broken invariants.
PoC explanation (one-liner):
When withdraw_shares() performs an external call to msg.sender without a reentrancy guard, the attack contract’s receive() re-enters fund_cyfrin() (or other state-changing calls) and manipulates accounting mid-withdrawal — demonstrating a successful reentrancy attack.
Explanation (brief)
Remove the comment-style # pragma nonreentrancy on and explicitly apply a reentrancy guard to all external functions that send value or call external contracts (e.g., withdraw_shares, refund branches in fund_investor, pay_holding_debt if it ever forwards funds). Also adopt checks→effects→interactions and prefer pull-over-push for payments.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.