verify-commits should also check for malicious code in merge commits #8089

issue MarcoFalke opened this issue on May 23, 2016
  1. MarcoFalke commented at 7:51 AM on May 23, 2016: member

    Assuming that the machine of a maintainer is compromised, it is possible to have the merge commit modified before sign and push.

    As we already have the requirement that "everyone without exception contributes patch proposals using pull requests." [1], I'd propose that we add the requirement that a pull request can only be merged when there is no merge conflict to be solved. Thus, verify-commits could not only check the signature of every merge commit but also fail when the merge commit modifies more code than the branch did that is about to be merged.

  2. MarcoFalke renamed this:
    verify-commits should also check for malicious code
    verify-commits should also check for malicious code in merge commits
    on May 23, 2016
  3. TheBlueMatt commented at 7:55 AM on May 23, 2016: member

    I spent a bunch of time re-writing verify-commits to validate that no merge commits at all may be unsigned, and decided the result including the restrictions it puts on git workflow, was too messy. But if we're willing to require certain git workflows, then I cant say I particularly mind that approach, in addition to this suggestion.

  4. MarcoFalke commented at 1:21 PM on May 23, 2016: member

    Right, it would probably require to overhaul our git workflow.

    Though, it is not required to verify every merge commit is signed. I think, it even should be avoided because it is known that some contributors prefer not to sign or don't even have a key.

    It should be sufficient to verify that the current HEAD of master is signed and also is a 'clean' merge (no conflicts solved, no additional diff). Afterward, verify recursively that each parent of that commit is either a valid (signed, clean merge) commit OR trusted_root OR a (likely unsigned) commit, which is known to be reviewed.

  5. jonasschnelli added the label Dev Scripts on May 23, 2016
  6. laanwj commented at 10:30 AM on May 30, 2016: member

    github-merge.py already refuses to merge if there are any conflicts, so in principle this should already be the case for top-level merges.

    I do think it should be possible for non-top-level merges (so those part of pull requests). Merges with conflict resolve exist for a good reason, and I don't think the use of git to accomplish development tasks (as well as convenience for contributors) should be unnecessarily restricted for paranoia reasons.

  7. MarcoFalke commented at 1:27 PM on May 30, 2016: member

    github-merge.py already refuses to merge if there are any conflicts, so in principle this should already be the case for top-level merges.

    Though there is no way for other people to check that? It's a local check and assuming a (un)intentionally compromised machine, it renders itself useless.

    I do think it should be possible for non-top-level merges (so those part of pull requests). Merges with conflict resolve exist for a good reason, and I don't think the use of git to accomplish development tasks (as well as convenience for contributors) should be unnecessarily restricted for paranoia reasons.

    ​ I agree. Keep in mind, that there would be no further restrictions on code contributors. Changing the workflow would only place a burden on reviewers. (E.g. having at least one reviewer sign the commit hash of a pull)

  8. laanwj closed this on Apr 7, 2018

  9. laanwj referenced this in commit b2e5fe8b55 on Apr 7, 2018
  10. TheArbitrator referenced this in commit 5d42405279 on Jun 4, 2021
  11. MarcoFalke locked this on Sep 8, 2021

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-17 06:15 UTC

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