CVE-2024-38365 public disclosure (btcd `FindAndDelete` bug)

Right, unless you’re using an OP_CODESEPARATOR the signature should commit to the scriptCode. Though there is still the possibility that the signature is invalid w.r.t the scriptCode and the script execution still valid.

What if you have : <invalid_sig+noise> <invalid_sig> <OP_CHECKSIG> <OP_SIZE> <length_invalid_sig+noise> OP_EQUALVERIFY.

In my understanding, core’ should only remove 1 instance of <invalid_sig>, fails on the CHECKSIG (though NULLFAIL policy only) and then succeed on the OP_SIZE. On the other hand, non-upgraded btcd should remove the 2 instances of <invalid_sig> (as invalid_sig+noise contains the invalid_sig) and fails the OP_SIZE + OP_EQUALVERIFY.