Skip to content

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 19 Nov 20:10
· 206 commits to main since this release

A security and fix release. RG02 now catches a prank as a contract the PoC
deploys from its own file (#17). --changed-since and verify-fix no
longer let an untrusted repository or patch run a program or write outside
the copy. New adversarial, fuzz-corpus and property tests ship with it; eight
adversarial cases the checker gets wrong today are committed as ignored tests
with their inputs (cargo test -- --ignored), so the gaps are on record. No
rule id, flag, default or output field changed, and the published precision
numbers are unchanged (re-measured on this build).

Security

  • --changed-since no longer lets a repository's own config run a program.
    A .git/config in the working tree could set core.fsmonitor, which git
    runs on an index refresh, and a filter attribute in .gitattributes or
    .git/info/attributes could name a clean filter, which git runs for a
    worktree comparison. Both ran. Every git call now goes through one helper
    that turns core.fsmonitor off. git is no longer asked to compare the
    worktree: realism-gate lists the blob ids at the revision (ls-tree) and
    hashes the current files with hash-object --no-filters, then compares the
    ids itself. A file that differs from the revision only in line endings is
    listed, which is checked rather than missed; a symbolic link is listed
    without being read. tests/security.rs plants each program and asserts it
    does not run.
  • --target-commit and --changed-since values that start with - are
    refused
    (exit 2). Tested; this was already enforced, and is now a regression
    test.
  • verify-fix refuses a patch that creates a symbolic link, and a patch
    over 8 MiB.
    git apply turns a mode 120000 entry into a link whose target
    is not checked, so a later read could leave the temp tree. The check runs
    before any apply. The size cap stops a huge patch being read whole into
    memory, with a clear error. A project symlink is not copied (already true;
    now tested), and drive-letter, verbatim and UNC spellings of an absolute path
    are tested as refused.
  • The host decision for verify-fix is pinned by tests.
    REALISM_GATE_SANDBOX=1 (and the /.dockerenv and /run/.containerenv
    markers) still count as an attestation, and docs/verify-fix.md says so. The
    policy is unchanged; tests/verify_fix_limits.rs makes a change visible.
  • Every third-party action in the workflows and action.yml is pinned to a
    commit SHA.
    Each uses: line names the commit and its version in a comment
    (# v7.0.1), and the major version is unchanged. Two taiki-e/install-action
    tags are named after the tool, with no version tag on the same commit, so
    their comment says cargo-audit tag and cargo-binstall tag. Local ./
    references are not affected.

Fixed

  • RG02 fires on a prank as a contract the test deployed from a type in its
    own file (#17).
    vm.prank(address(vault)) and vm.startPrank(address(vault))
    with vault = new Vault(), where Vault is defined in the PoC file, was
    read as a helper and not as the protocol, so the attacker claim was SHOWN.
    It is now flagged, and the claim is CONTRADICTED. Three cases stay quiet: a
    contract named for the attacker, a contract the attacker deploys under
    startPrank(attacker), and a hard-coded literal address (unchanged, out of
    scope). The published measurements do not change; see the PR for the
    before and after numbers.

Documentation

  • SECURITY.md states the guarantee per command. It said the tool "runs no
    Solidity", which was true of check and false of verify-fix, which runs
    forge on the PoC. The table now says what each command executes and what
    it reaches on the network.
  • docs/threat-model.md is new. A short STRIDE-light model: assets,
    attackers, trust boundaries with file:line references, the guarantees and
    what proves each one, and the open hypotheses with their status.

Tests

  • tests/adversarial.rs: PoCs and reports written to fool the checker. It
    covers a privileged address reached through a local variable, a helper
    contract, and an abi.encode/abi.decode round trip; a prank and an
    assertion inside if (false) or after return; a claims file and front
    matter that disagree; a non-ASCII identifier; a 5 MB file; and a deeply
    nested expression. Each case states what the tool should do. Eight cases fail
    today and are #[ignore]d with the reason, and the inputs are listed in the
    pull request. No rule changed.
  • Fuzz targets for every parser, in fuzz/. One cargo-fuzz target each
    for the Solidity, Rust, TypeScript and Move frontends, the claims YAML and
    front matter (with the prose heuristics), and realism.yaml. The property is
    that no target panics. The crate is excluded from the main workspace, so a
    normal build needs no nightly. Its seed corpus is copied from the test
    fixtures and examples.
  • tests/fuzz_corpus.rs replays the corpus on every cargo test. It runs
    the same target bodies over each seed and over a fixed set of deterministic
    mutations. cargo-fuzz does not run on Windows, so this is the check that runs
    everywhere.
  • fuzz.yml, a weekly five-minute fuzz run per target on Linux. It uploads
    crashing inputs as an artifact.
  • Property tests (proptest) in tests/properties.rs. For generated inputs,
    not only the fixtures: the JSON report does not depend on the order the files
    are given; adding an unrelated test function does not change the findings of
    the tests already in the file; every JSON report validates against
    docs/output-schema.json, and every SARIF log has the keys SARIF 2.1.0
    requires. The schema checker moved to tests/support/ so both tests share it.
  • docs/test-quality.md: line coverage and the mutant count for the rule
    code.
    Whole-crate line coverage is 87.77%; the least-covered rule files are
    listed. Mutation outcomes are not recorded yet: a full cargo mutants run
    takes hours here, so the page says so rather than estimating a survival rate.
    Linked from CONTRIBUTING.md. Nothing is gated on these numbers.

Install

cargo binstall realism-gate

or download an archive below and check it:

sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate

Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).