Skip navigation
Finally... The one vulnerability class that is: • Ridiculously common • High severity • Has netted…
0:00 / 26:51

Finally... The one vulnerability class that is: • Ridiculously common • High severity • Has netted…

Owen | Guardian

@0xOwenThurm13K followers

Visit on X
227 likesDownloadOriginal post

21,029 views

Finally... The one vulnerability class that is: • Ridiculously common • High severity • Has netted me dozens of findings • Nobody talks about it And it is... 🧵

24 Comments

Comments from the original post on X (Twitter)

  • Owen | Guardian's profile picture

    @0xOwenThurm

    ✨Stepwise Jumps ✨ I promise, If you find yourself looking at a stepwise jump in a DeFi protocol: You have a finding on your hands.

    8 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    Stepwise Jumps can come in many forms: - Reward compounds - Interest rate updates - Pricing changes - Vault balances The list goes on...

    6 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    And every instance is bad news... Let's talk about each.🫡

    2 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    → Reward Compounds The most basic of the stepwise jump exploits is a simple reward compound. Let's imagine this chart represents the value of a reward system. Every user owns a share of the pot, when the pot value increases → users make money.

    2 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    The jump is from a reward increase. So what's the problem here? Well, we're looking at a stepwise jump.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    The instantaneous reward increase pays no mind to the length of time a user was a part of the pot. A strategic user may join the pot right before at point A & exit right after the reward increase at point B. ... And make the same rewards as every other user.😉

    2 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    The most malicious exploitation of this stepwise jump involves specifically frontrunning and backrunning the reward increase. You can get a full introduction to frontrunning right here 👇

    2 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    See STK-1 in the following report for a real-audit example:

    3 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    Okay, so how do we solve this issue? There are several options: - Implement a withdrawal fee - Add a cooldown/lock period - distribute rewards linearly over time (best)

    2 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    → Interest Rate Updates Here's one that I can always count on for a Medium... Let's consider this graph of the interest rate charged to borrowers.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    Can you see the problem here? Let's say Bob has a loan of 100 USDC at a 10% interest rate @ t=0. At t=5 the interest rate is updated to 8%. At t=6 Bob updates his position and settles his interest.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    Bob updated his position and settled his interest at time 6 when the interest rate was 8%. However, the interest rate was 10% for most of the position's life. Therefore Bob avoided paying the appropriate amount of interest for the period 0<=t<=5.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    See DATA-3 in the following report for a real-audit example of this one:

    2 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    So what's the appropriate solution for errant rate accounting? The best solution is to update the outstanding interest/rewards/whatever it may be before assigning the new rate. If the amount is tracked on a per-user basis it should be converted to a protocol-wide tracking.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    → Pricing Changes The following is a graph of the pricing of an asset which is determined on-chain. What's the problem?

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    Let's consider that the asset is accepted as collateral by a lending protocol. Such a stepwise reduction in the valuation of the asset could leave the lending protocol with bad debt.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    When you're reviewing protocols it's always helpful to examine the risks that may be present for 3rd parties & integrations. Stepwise jumps are certainly not friendly to interoperability and this is just one example.

    1 like

  • Owen | Guardian's profile picture

    @0xOwenThurm

    So how do we fix pricing jump risks? - Remove the pricing jump if possible - Add fees to disincentivize causing such a jump - Warn integrators

    5 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    → Vault Balances And finally... Here is a graph of the attributed value of a vault system. Look familiar?

    3 likes

  • Owen | Guardian's profile picture

    @0xOwenThurm

    It's our good friend, the stepwise jump. :) And this time he has a classic in store -- the inflation attack!

    3 likes