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

and additional padding data.

In my understanding of the bug, there is feeding of the two consensus-nodes, with the following scriptCode, where the ECDSA sig and the "noise dummy data must match the length declared in pushed bytes.


  1-byte        1-byte       ECDSA sig-bytes   "noise" dummy data-bytes

OP_PUSHDATA1 <bytes pushed> <signature> <padding data>

One should note that ECDSA sig length is malleable.

The non-upgraded, pre-0.24.2 btcd peers should remove the whole data push containing the consensus valid signatures, before it’s verified by the script interpreter. While bitcoind peers can accept the valid signatures. I’m unsure that you really need public key recovery to achieve that chain fork as a trick. I believe one has OP_PICK, OP_ROLL and other stack inspection opcodes available, that can be committed in the scriptCode.