Normal Behavior:
The fund_investor() function allows users to invest ETH and receive shares proportional to their contribution.
The price per share is calculated using the company’s net worth (company_balance - holding_debt) divided by the number of issued shares.
Specific Issue:
When issued_shares > 0 but net_worth is too low (zero or less than issued_shares),
the division result net_worth // issued_shares becomes 0.
Later, the code uses this zero value to calculate how many shares to issue, causing a division by zero revert.
Likelihood:
1.This will occur whenever the company’s balance roughly equals or falls below its holding debt, making net_worth = 0.
2.It’s also likely to happen during insolvency or low-liquidity periods when no capital has been injected by the owner.
Impact:
1.All new investments will revert, effectively freezing the funding process.
2.The company cannot recover from insolvency through new investor funding, causing a permanent Denial-of-Service.
Explanation:
When issuedShares > 0 but the company’s netWorth equals zero, the computed sharePrice becomes 0, causing msg.value / sharePrice in fundInvestor() to revert with a division-by-zero panic (0x12) — effectively freezing the investment process and demonstrating the vulnerability.
Explanation
Ensure that share_price never equals zero before performing the division.
Either fallback to a minimum price or reject investments when the company’s net worth is zero.
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.