gabriel / muse public
task/verify-review #1 / 1
AI Agent gabriel · 145 days ago · Apr 26, 2026 · Diff

verify: add path traversal guard and 27 extended integrity tests

- _branch_refs: reject absolute paths and '..' components in branch param to prevent path traversal outside the heads directory - Add tests/test_verify_extended.py with 27 tests covering signature verification, merge commit BFS, ref security, TOCTOU, JSON schema completeness, and counter accuracy

sha256:33921957dbf17470e60760b6b0a43226f1fc92e02dfa950811ecf8dd6fd6ec63 sha
+73 ~1 symbols
sha256:371186750fd84d86c792c645fb88f273cad6ab85d97238215777a09d8f2942f9 snapshot
+73
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 74 symbols
~ tests/test_verify_extended.py .py 73 symbols added
+ TestCounterAccuracy class class TestCounterAccuracy L820–998
+ _make_raw_commit method method _make_raw_commit L970–998
+ test_c1_same_object_across_two_snapshots_counted_once method method test_c1_same_object_across_two_snapshots_counted_once L823–872
+ test_c2_signatures_checked_exact_count method method test_c2_signatures_checked_exact_count L874–889
+ test_c3_hash_mismatch_error_shows_both_ids method method test_c3_hash_mismatch_error_shows_both_ids L891–931
+ test_c4_commit_count_accurate_on_diamond_dag method method test_c4_commit_count_accurate_on_diamond_dag L933–968
+ TestIOErrorHandling class class TestIOErrorHandling L702–745
+ test_t1_object_deleted_between_state_check_and_read method method test_t1_object_deleted_between_state_check_and_read L705–745
+ TestJsonSchema class class TestJsonSchema L753–812
+ test_j1_strict_field_present_in_json method method test_j1_strict_field_present_in_json L756–763
+ test_j2_strict_false_by_default method method test_j2_strict_false_by_default L765–770
+ test_j2b_strict_true_when_flag_passed method method test_j2b_strict_true_when_flag_passed L772–777
+ test_j3_check_objects_present_in_all_branches method method test_j3_check_objects_present_in_all_branches L779–788
+ test_j4_all_documented_fields_present method method test_j4_all_documented_fields_present L790–804
+ test_j5_failures_list_empty_when_all_ok method method test_j5_failures_list_empty_when_all_ok L806–812
+ TestMergeCommits class class TestMergeCommits L483–629
+ _make_branch_commit method method _make_branch_commit L486–515
+ test_m1_merge_commit_both_parents_walked method method test_m1_merge_commit_both_parents_walked L517–555
+ test_m2_corrupt_object_in_second_parent_chain_detected method method test_m2_corrupt_object_in_second_parent_chain_detected L557–596
+ test_m3_missing_second_parent_commit_reported method method test_m3_missing_second_parent_commit_reported L598–629
+ TestRefSecurity class class TestRefSecurity L637–694
+ test_p1_path_traversal_via_branch_param_does_not_escape method method test_p1_path_traversal_via_branch_param_does_not_escape L640–660
+ test_p2_absolute_path_branch_does_not_read_outside_repo method method test_p2_absolute_path_branch_does_not_read_outside_repo L662–680
+ test_p3_binary_ref_file_handled_gracefully method method test_p3_binary_ref_file_handled_gracefully L682–694
+ TestSignatureVerification class class TestSignatureVerification L194–475
+ test_s10_signature_failure_error_names_agent method method test_s10_signature_failure_error_names_agent L444–475
+ test_s1_valid_signed_commit_passes method method test_s1_valid_signed_commit_passes L201–211
+ test_s2_tampered_payload_detected method method test_s2_tampered_payload_detected L213–243
+ test_s3_bit_flip_in_signature_bytes_detected method method test_s3_bit_flip_in_signature_bytes_detected L245–279
+ test_s4_unknown_signature_algorithm_reported method method test_s4_unknown_signature_algorithm_reported L281–312
+ test_s5_unknown_pubkey_algorithm_reported_as_key_missing method method test_s5_unknown_pubkey_algorithm_reported_as_key_missing L314–348
+ test_s6_malformed_pubkey_base64_causes_signature_failure method method test_s6_malformed_pubkey_base64_causes_signature_failure L350–384
+ test_s7_empty_signer_public_key_reported_as_key_missing method method test_s7_empty_signer_public_key_reported_as_key_missing L386–416
+ test_s8_unsigned_commits_not_counted method method test_s8_unsigned_commits_not_counted L418–427
+ test_s9_mixed_chain_counts_only_signed method method test_s9_mixed_chain_counts_only_signed L429–442
+ _REPO_ID variable variable _REPO_ID L71–71
+ _commit function function _commit L100–165
+ _env function function _env L168–169
+ _force_write_commit function function _force_write_commit L172–181
+ _init_repo function function _init_repo L79–87
+ _invoke function function _invoke L184–186
+ _make_key function function _make_key L94–97
+ _sha function function _sha L90–91
+ Any import import Any L52–52
+ CliRunner import import CliRunner L55–55
+ CommitRecord import import CommitRecord L66–66
+ InvokeResult import import InvokeResult L55–55
+ Mapping import import Mapping L51–51
+ SnapshotRecord import import SnapshotRecord L66–66
+ annotations import import annotations L44–44
+ blob_id import import blob_id L67–67
+ compute_commit_id import import compute_commit_id L65–65
+ compute_snapshot_id import import compute_snapshot_id L65–65
+ datetime import import datetime L46–46
+ encode_pubkey import import encode_pubkey L67–67
+ encode_public_key import import encode_public_key L58–58
+ json import import json L47–47
+ long_id import import long_id L67–67
+ object_path import import object_path L57–57
+ os import import os L48–48
+ pathlib import import pathlib L49–49
+ provenance_payload import import provenance_payload L58–58
+ pytest import import pytest L54–54
+ run_verify import import run_verify L68–68
+ short_id import import short_id L67–67
+ sign_commit_ed25519 import import sign_commit_ed25519 L58–58
+ sign_commit_record import import sign_commit_record L58–58
+ threading import import threading L50–50
+ verify_commit_ed25519 import import verify_commit_ed25519 L58–58
+ write_commit import import write_commit L66–66
+ write_object import import write_object L57–57
+ write_snapshot import import write_snapshot L66–66
+ runner variable variable runner L70–70
~ muse/core/verify.py .py 1 symbol modified
← Older Oldest on task/verify-review
All commits
Newer → Latest on task/verify-review

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:33921957dbf17470e60760b6b0a43226f1fc92e02dfa950811ecf8dd6fd6ec63 --body "your comment"