Project Name: Algo Ssstablecoinsss
Repository: Cyfrin/2024-12-algo-ssstablecoinsss (Commit: 4cc3197)
Date: 2026-08-29
Auditor: Smart Chain Audit Agent (Google AI / Antigravity)
A targeted security audit was conducted on the Algo Ssstablecoinsss smart contracts on ZKsync Era, focusing on finding HIGH-01: burn_dsc reverting when an undercollateralized user attempts to partially repay debt.
| Severity | Count | Resolved | Acknowledged |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 1 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 0 | 0 | 0 |
| Informational | 0 | 0 | 0 |
| Total | 1 | 0 | 0 |
| File Path | Logic Overview | SWC / Risk Focus |
|---|---|---|
src/dsc_engine.vy |
Debt burning and health factor validation | SWC-128 (DoS / Denial of Service) |
burn_dsc Unnecessarily Asserts Health Factor, Trapping Undercollateralized Users and Forcing LiquidationSeverity: High
Status: Confirmed / PoC Verified
Vulnerability Class: SWC-128 (Denial of Service / Unintended State Lockup)
Affected File(s): src/dsc_engine.vy:L149-L151
In standard lending protocols and CDP engines, burning debt (repaying tokens) strictly improves the solvency of the protocol and increases the borrower's health factor. A borrower whose position is threatened by liquidation must be permitted to repay any portion of their debt to de-risk their position.
In dsc_engine.vy, burn_dsc() allows a caller to burn DSC and reduce their outstanding debt. However, after executing _burn_dsc(), the function executes self._revert_if_health_factor_is_broken(msg.sender):
In _calculate_health_factor:
Because total_dsc_minted is the denominator, burning DSC causes the health factor to strictly increase.
However, if a borrower's health factor drops below MIN_HEALTH_FACTOR (1.0) due to market downturns (e.g. Health Factor = 0.8), and the user attempts a partial repayment (e.g. repaying 20% of their debt, raising their Health Factor to 0.95), line 151 verifies whether the resulting health factor is .
Because 0.95 is still , _revert_if_health_factor_is_broken reverts the entire transaction.
The following test executed via uv run mox test tests/unit/test_pocs.py -s proves that an undercollateralized borrower attempting to partially pay off debt is rejected:
PoC Verification Log Output:
Borrower Trapped in Liquidation: Distressed users cannot reduce their debt gradually. Unless they have enough capital to repay the entire shortfall in a single transaction, all attempts to pay off debt are blocked.
Increased Protocol Bad Debt: Disincentivizes borrower self-rescue, guaranteeing that positions drop further into underwater territory and trigger liquidation fees and bad debt.
Remove self._revert_if_health_factor_is_broken(msg.sender) from burn_dsc(). Burning debt can never decrease health factor.
(Note: redeem_collateral_for_dsc must retain the health factor check because it withdraws collateral).
Moccasin / Titanoboa Unit Test: test_poc_burn_dsc_reverts_when_health_factor_broken passed in 3.55s.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.