{
 "number": 35873,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35873",
 "title": "test: add a tx_valid vector for CVE-2024-38365",
 "author": "jeanpablojp",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-08-03T22:30:26Z",
 "updated_at": "2026-09-16T13:09:28Z",
 "age_days": 44,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "6cd2fa5fb4b6d25b8400d2a7683ceb78610c0b4f",
 "head_ref": "test-cve-2024-38365-vector",
 "head_repo": "jeanpablojp/bitcoin",
 "head_history": [],
 "additions": 7,
 "deletions": 0,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "sedited",
      "url": "https://github.com/bitcoin/bitcoin/pull/35873#pullrequestreview-5223091107"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "sedited": {
   "kind": "ack",
   "hash": "6cd2fa5fb4b6d25b8400d2a7683ceb78610c0b4f",
   "t": "2026-09-16T13:09:25Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 1,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 1,
  "changes_requested": 0,
  "distinct_reviewers": [
   "sedited"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-08-03T22:17:47Z",
  "last_reviewer_activity": "2026-09-16T13:09:25Z",
  "last_reviewer": "sedited",
  "author_silent_days": 44,
  "waiting_on_author_days": 1,
  "days_since_update": 1
 },
 "refs": {
  "mentioned": [
   35835
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 35835,
    "type": "pull",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "test: add CONST_SCRIPTCODE failure-path vectors to script_tests.json"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "Suggested by darosior in #35835.\n\n`FindAndDelete` only matches whole pushes at opcode boundaries, so a push that carries the signature inside its data is left in the scriptCode. btcd (<0.24.2) removed any push containing the signature, computed a different sighash, and would have rejected a transaction Core accepts: the chain split in [CVE-2024-38365](https://delvingbitcoin.org/t/cve-2024-38365-public-disclosure-btcd-findanddelete-bug/1184).\n\nThe rule is already covered from the failure side, in `script_FindAndDelete` and in the `tx_invalid.json` vectors where the signature sits under a non-standard pushdata prefix. What was missing is the positive direction: a transaction Core must accept because nothing is deleted.\n\nThis adds one vector to `tx_valid.json`, with `OP_CHECKSIGVERIFY <0xaaaa||sig>` as the P2SH redeemScript and the minimal 8-byte DER signature (r = s = 1). The pubkey is recovered from that signature and the sighash Core computes, so it verifies only if the `<0xaaaa||sig>` push survives into the scriptCode. `CONST_SCRIPTCODE` doesn't fire \u2014 `FindAndDelete` finds nothing \u2014 and the vector runs with every flag.\n\nTo check it actually discriminates, I patched `EvalChecksigPreTapscript` to drop any push whose data contains the signature, the way btcd did. The vector fails with that patch and passes without it.\n\nTested with:\n\n```\nbuild/bin/test_bitcoin --run_test=transaction_tests\n```",
 "commits": [
  {
   "sha": "6cd2fa5fb4b6d25b8400d2a7683ceb78610c0b4f",
   "date": "2026-08-03T22:17:47Z",
   "message": "test: add a tx_valid vector for CVE-2024-38365"
  }
 ],
 "timeline": [
  {
   "t": "2026-09-16T13:09:25Z",
   "kind": "review",
   "who": "sedited",
   "assoc": "MEMBER",
   "state": "APPROVED",
   "commit": "6cd2fa5fb4b6d25b8400d2a7683ceb78610c0b4f",
   "text": "ACK 6cd2fa5fb4b6d25b8400d2a7683ceb78610c0b4f\n\nAlso checked that a mutation doing a btcd-style delete fails the test."
  }
 ],
 "labels_log": [
  {
   "t": "2026-08-03T22:30:30Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-04T10:04:37Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-04T15:44:47Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-08-04T14:07:49Z",
   "kind": "closed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-08-04T14:07:53Z",
   "kind": "reopened",
   "who": "DrahtBot"
  }
 ],
 "text_chars": 1623,
 "text_tokens_estimate": 405,
 "changed_paths": [
  "src/test/data/tx_valid.json"
 ],
 "files": [
  {
   "path": "src/test/data/tx_valid.json",
   "add": 7,
   "del": 0
  }
 ],
 "test_lines": 7,
 "git": {
  "head": "6cd2fa5fb4b6d25b8400d2a7683ceb78610c0b4f",
  "head_matches_backup": true,
  "base": "1ed14c61222e2524745837d926fbbb353a82c4f0",
  "commits": [
   {
    "sha": "6cd2fa5fb4",
    "subject": "test: add a tx_valid vector for CVE-2024-38365",
    "files": 1,
    "add": 7,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "e8d134f745a6219e",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}