_revert_if_health_factor_is_broken enforces a single MIN_HEALTH_FACTOR = 1e18 for every collateral, and the health factor is derived from _get_usd_value, which scales all amounts by PRECISION = 1e18 as if every token had 18 decimals.
WBTC has 8 decimals, so its USD valuation and resulting user_health_factor are off by a factor of 1e10 relative to the 18-decimal assumption baked into MIN_HEALTH_FACTOR. The health-factor logic is effectively implemented only for WETH; WBTC is mishandled.
Likelihood:
WBTC is an in-scope collateral token (README: "Tokens: WETH and WBTC") and on the target chain has 8 decimals, so the mismatch applies to every WBTC position once the protocol is deployed with real WBTC.
The 18-decimal MIN_HEALTH_FACTOR and PRECISION constants are fixed, so the discrepancy is deterministic, not conditional.
Impact:
For WBTC, user_health_factor is inflated by ~1e10 versus its true value, so _revert_if_health_factor_is_broken passes positions that are actually undercollateralized — WBTC borrowers can mint far more DSC than their collateral backs.
The same inflation makes undercollateralized WBTC positions read as healthy, so they cannot be liquidated, leaving the protocol with unbacked DSC and bad debt.
With an 8-decimal WBTC, the health-factor check evaluates a value scaled for 18 decimals. Depositing 1 WBTC (1e8 base units) yields a USD value ~1e10 too small in _get_usd_value, and conversely the per-position health factor is inflated relative to the 18-decimal MIN_HEALTH_FACTOR threshold:
Run: mox test --match test_poc_wbtc_health_factor -vvv
Observed: 1 WBTC is valued ~1e10 below its true USD value, so the MIN_HEALTH_FACTOR check in _revert_if_health_factor_is_broken is evaluated against a mis-scaled health factor for WBTC.
Normalize every collateral amount to 18 decimals before valuation so a single MIN_HEALTH_FACTOR applies correctly to all tokens — store a per-token precision factor (10 ** (18 - decimals())) at construction and apply it in _get_usd_value:
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.