Files
r4bbit 0fa101df14 fix(StakeVault): add lockUntil validity check
In case the `StakeManager` is malicious and returns `lockUntil` values
that don't make sense, we calculate the new `lockUntil` values in the
`StakeVault` to compare against those.

If the values coming from `StakeManager` are not matching, something's
off and we revert.

We still do `lockUntil` calculations in `StakeManager` via `StakeMath`
to ensure absolute max MP isn't exceeded.

We don't have the notion of multiplier points in the `StakeVault`, nor
should it know about it. Hence, we're just doing the `lockUntil`
calculation.

**Note**

This introduces another "vulnerability" that I consider "acknowledged",
but won't fix:

In theory, a malicious stake manager upgrade could remove the upper
bound checks on absolute max MP. In such a case, users could pass a very
large `lockUntil` to `StakeVault`. `StakeManager` would simply calculate
the same `lockUntil` but wouldn't revert on the max cases.

So in other words, users can hurt themselves if stake manager removed
the check and users willingly lock for very long time.

Closes #249
2025-08-26 15:40:40 +02:00
..