55806 bc insight critical missing input validation in governance parameter allows malicious underflow leading to permanent freeze of all dpos rewards
Description
A. The Unvalidated Setter (builtin/params/params.go)
func (p *Params) Set(key thor.Bytes32, value *big.Int) error {
return p.state.EncodeStorage(p.addr, key, func() ([]byte, error) {
// No validation on 'value' for the given 'key'
if value.Sign() == 0 {
return nil, nil
}
return rlp.EncodeToBytes(value)
})
}B. The Exploitable Calculation (builtin/energy/energy.go)
Impact Details
References
Proof of Concept
Suggested Remediation
Previous55925 bc insight underpriced supply queries enable cheap cpu dosNext55711 sc insight redundant gas charge in native addvalidation function leads to unnecessary gas costs
Was this helpful?