harden: buffer allocation uses addition (pcp_hdr_size +... in pcp.cpp #36016

pull anupamme wants to merge 1 commits into bitcoin:master from anupamme:fix-repo-bitcoin-pcp-buffer-overflow-check changing 1 files +1 −0
  1. anupamme commented at 7:30 AM on August 19, 2026: none

    Summary

    Harden input handling in src/common/pcp.cpp (flagged by multi_agent_ai).

    Vulnerability

    Field Value
    ID V-002
    Severity HIGH
    Scanner multi_agent_ai
    Rule V-002
    File src/common/pcp.cpp:380
    Assessment Defensive hardening

    Description: Buffer allocation uses addition (PCP_HDR_SIZE + PCP_MAP_SIZE) without overflow checking. While currently using compile-time constants, this pattern is risky if code is refactored to use dynamic sizes. Offset calculations for writing data also lack bounds validation.

    Threat Model Context

    This is a local CLI tool - exploitation requires the attacker to control command-line arguments or input files.

    Changes

    • src/common/pcp.cpp

    Behavior Preservation

    The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


    This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.


    Automated security fix by OrbisAI Security

  2. fix: V-002 security vulnerability
    Automated security fix generated by OrbisAI Security
    2efa9f3a19
  3. DrahtBot commented at 7:31 AM on August 19, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36016.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. sedited commented at 7:45 AM on August 19, 2026: contributor

    AI slop

  5. sedited closed this on Aug 19, 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-08-21 04:51 UTC

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