#37134 [BC-Insight] Improper secp256k sanitization
Description
Description
func ConvertToInterfacePubkey(pubkey *ecdsa.PublicKey) (crypto.PubKey, error) {
xVal, yVal := new(btcec.FieldVal), new(btcec.FieldVal)
if xVal.SetByteSlice(pubkey.X.Bytes()) {
return nil, errors.Errorf("X value overflows")
}
if yVal.SetByteSlice(pubkey.Y.Bytes()) {
return nil, errors.Errorf("Y value overflows")
}
// @audit does not verify that the pubkey is on the secp256k1 curve
newKey := crypto.PubKey((*crypto.Secp256k1PublicKey)(btcec.NewPublicKey(xVal, yVal)))
// Zero out temporary values.
xVal.Zero()
yVal.Zero()
return newKey, nil
}Recommended Patch
Proof of Concept
Proof of Concept
Previous#37695 [BC-Insight] Executing transaction that has a wrong nonce might triggered a chain split due to mismatch staterootNext#38554 [BC-Low] Incorrect Transaction Fee Check in `SendRawTransaction()`
Was this helpful?