fix: the der signature parsing code in pubkey in pubkey.cpp #35178

pull orbisai0security wants to merge 1 commits into bitcoin:master from orbisai0security:fix-v-002-ecdsa-der-buffer-bounds-check changing 1 files +2 −0
  1. orbisai0security commented at 7:32 AM on April 29, 2026: none

    Summary

    Fix critical severity security issue in src/pubkey.cpp.

    Vulnerability

    Field Value
    ID V-002
    Severity CRITICAL
    Scanner multi_agent_ai
    Rule V-002
    File src/pubkey.cpp:160

    Description: The DER signature parsing code in pubkey.cpp copies the r and s components of an ECDSA signature into a fixed 64-byte stack buffer (tmpsig) using memcpy. The destination offsets are computed as (tmpsig + 32 - rlen) and (tmpsig + 64 - slen). If rlen or slen exceed 32, the arithmetic produces a pointer before the start of the buffer (pointer underflow), writing attacker-controlled bytes to arbitrary stack or heap memory before tmpsig. No bounds check on rlen/slen against the value 32 is present in the reported code.

    Changes

    • src/pubkey.cpp

    Verification

    • Build passes
    • Scanner re-scan confirms fix
    • LLM code review passed

    Automated security fix by OrbisAI Security

  2. fix: V-002 security vulnerability
    Automated security fix generated by Orbis Security AI
    1c2577d8b9
  3. DrahtBot commented at 7:33 AM on April 29, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. maflcko commented at 7:36 AM on April 29, 2026: member

    ai slop

  5. maflcko closed this on Apr 29, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me