Repository navigation
v1.0.2
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-sinceno longer lets a repository's own config run a program.
A.git/configin the working tree could setcore.fsmonitor, which git
runs on an index refresh, and afilterattribute in.gitattributesor
.git/info/attributescould name a clean filter, which git runs for a
worktree comparison. Both ran. Every git call now goes through one helper
that turnscore.fsmonitoroff. 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 withhash-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.rsplants each program and asserts it
does not run.--target-commitand--changed-sincevalues that start with-are
refused (exit 2). Tested; this was already enforced, and is now a regression
test.verify-fixrefuses a patch that creates a symbolic link, and a patch
over 8 MiB.git applyturns a mode120000entry 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-fixis pinned by tests.
REALISM_GATE_SANDBOX=1(and the/.dockerenvand/run/.containerenv
markers) still count as an attestation, anddocs/verify-fix.mdsays so. The
policy is unchanged;tests/verify_fix_limits.rsmakes a change visible. - Every third-party action in the workflows and
action.ymlis pinned to a
commit SHA. Eachuses:line names the commit and its version in a comment
(# v7.0.1), and the major version is unchanged. Twotaiki-e/install-action
tags are named after the tool, with no version tag on the same commit, so
their comment sayscargo-audit tagandcargo-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))andvm.startPrank(address(vault))
withvault = new Vault(), whereVaultis 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 ofcheckand false ofverify-fix, which runs
forgeon the PoC. The table now says what each command executes and what
it reaches on the network. docs/threat-model.mdis new. A short STRIDE-light model: assets,
attackers, trust boundaries withfile:linereferences, 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 anabi.encode/abi.decoderound trip; a prank and an
assertion insideif (false)or afterreturn; 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), andrealism.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.rsreplays the corpus on everycargo 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) intests/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 totests/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 fullcargo mutantsrun
takes hours here, so the page says so rather than estimating a survival rate.
Linked fromCONTRIBUTING.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).