Repository navigation
fix(security): add integrity check for global TOML filters - #1068
Closed
pszymkowiak wants to merge 1 commit into
Closed
pszymkowiak wants to merge 1 commit into
pszymkowiak wants to merge 1 commit into
Conversation
Global filters (~/.config/rtk/filters.toml) were loaded without any integrity verification, unlike project-local filters which require SHA-256 trust. A supply-chain attack (e.g. npm postinstall script) could write to ~/.config/rtk/ to suppress security scanner output or rewrite command output via replace/match_output rules. Now: first load silently records a SHA-256 baseline. If the file changes unexpectedly, RTK warns and refuses to load until the user runs `rtk trust --global` to review and accept. Ref: issue #640 (H-3 finding) Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]>
thehoff
added a commit
to thehoff/contextcrawler
that referenced
this pull request
May 15, 2026
Three factual fixes from Codex's pass on the v1 of these docs: 1. THREAT_MODEL.md path references — all `cmds/...`, `core/...`, `hooks/...` paths now use the `src/...` prefix so they actually resolve when followed from repo root. 10 paths updated. 2. THREAT_MODEL.md hook filename — the integrity check is on `rtk-rewrite.sh`, not `contextcrawler-rewrite.sh`. Internal `rtk-` prefix is retained per the rebrand-internals-later policy (commits a26ebba / bb473fd). Updated the table entry and noted the policy. 3. AUDIT-2026-05-15.md H-3 disposition — was claimed "Fixed upstream (PR rtk-ai#1068) — Inherited", but verification against src/core/toml_filter.rs:218-222 shows the global filter path `~/.config/rtk/filters.toml` is still loaded without a trust check. Project-local `.rtk/filters.toml` IS trust-gated; only the global wasn't. Real downstream gap. Corrected disposition; added matching entry to THREAT_MODEL.md accepted-limitations with explicit "do not carry into v0.2.0" note. Also: cross-branch references to `scripts/build-release.sh` and `docs/quality/...` now annotated with which branch they ship on, so the docs are still useful when this branch is read in isolation before the v0.1.6 merge train lands.
4 tasks done
Contributor
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
Contributor
|
Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.config/rtk/filters.toml) were loaded without integrity verificationnpm postinstall) could silently modify global filters to suppress security output or rewrite commandsrtk trust --globalrtk trust --globalcommand to review and accept global filter changesRef: #640 (H-3 finding from security audit)
Changes
src/hooks/trust.rs:check_global_integrity(),GlobalFilterStatusenum,run_trust_global()+ 5 testssrc/core/toml_filter.rs: integrity gate before loading global filters (SA-2025-RTK-002)src/main.rs:--globalflag onrtk trustTest plan
~/.config/rtk/filters.toml, run any rtk command (baseline recorded), modify file, run again (warning + filters blocked), runrtk trust --global(accepted)