Skip to content
Leaked secrets Audit finding Intermediate

Hardcoded USD pegs can be broken

The protocol hardcoded the prices of USDC and USDT to parity, assuming they would always be worth one dollar. If either stablecoin de-pegged, the protocol would misprice assets and could suffer losses similar to other lending protocols.

hickuphh3 Follow

Originally disclosed on Code4rena

Submitted by hickuphh3, also found by 141345, Critical, linmiaomiao, and sorrynotsorry

The prices of USDC and USDT, which (I assume) are the underlying tokens of cUSDC and cUSDT, have been hardcoded to parity. Such practices are highly discouraged because while the likelihood of either stablecoin de-pegging is low, it is not zero.

Because of the UST debacle, the price of USDT dropped to $0.95 before making a recovery.

Impact

Here is an example of how [a lending protocol on Fantom was affected by such a depeg event because they hardcoded the value](https://code4rena.com/reports/2022-09-canto/%5Bhttps:/cryptoslate.com/scream-protocol-losses-millions-to-stablecoin-depeg/%5D(https:/cryptoslate.com/scream-protocol-losses-millions-to-stablecoin-depeg/%29).

To quote philosopher George Santayana, “Those who cannot remember the past are condemned to repeat it.”

Recommended Mitigation Steps

Consider using a price feed by trusted and established oracle providers like Chainlink, Band Protocol or Flux. The USDC/NOTE or USDT/NOTE price feed may be used as well, but NOTE has its own volatility concerns.


The original report as published on Code4rena, by hickuphh3. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

If either stablecoin de-pegs, the protocol could suffer losses similar to other lending protocols that hardcoded stablecoin prices.

What the attacker needed

Stablecoin de-pegs from $1

The fix

The protocol should use a trusted price feed such as Chainlink, Band Protocol, or Flux instead of hardcoding the price.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Stablecoins are digital currencies designed to always be worth one dollar. This protocol assumed that USDC and USDT would always be exactly one dollar, so it didn't check their real market price. If a stablecoin temporarily lost its peg (like USDT did in 2022), the protocol would still treat it as worth a dollar, which could cause financial losses.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by hickuphh3

View all

43 more disclosed reports, best first.

More from Canto

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.