Fix security audit findings and add license, MCP, scan modules#53
Merged
Fix security audit findings and add license, MCP, scan modules#53
Conversation
…ist, and hardening Six security fixes from external audit: - SEC-CRIT-01: Handle unexpected tirith exit codes in all shell hooks. Bash enter mode degrades to preexec; zsh/fish/PS warn+execute; all paste paths fail-closed (discard). - SEC-HIGH-01: Interpreter allowlist in runner.rs — two-tier matching (exact names + versioned families like python3.11). Check runs before user confirmation prompt. - SEC-HIGH-03: Bounded stdin read in paste.rs — 1 MiB cap via Read::take(). - SEC-HIGH-04: File permissions 0600 on audit log, receipts, cache, and last-trigger files (new files + legacy hardening via set_permissions). - SEC-MED-03: SHA256 hex validation in receipt load/save/verify — prevents path traversal via crafted hash values. - Short-hash panic guard: safe truncation via truncate_bytes() replaces all &sha256[..12] slice operations. Also includes Issue #20 bash enter mode infrastructure (bind-x override, startup health gate, persistent safe mode, degrade-to-preexec) and CR normalization improvements from prior work on this branch. Additional fixes: - Fix audit test env var race (test OpenOptions pattern directly) - Trim whitespace from XDG_STATE_HOME in state_dir() - Bump version to 0.1.9 230 tests passing (148 unit + 44 integration + 18 golden + 17 policy + 3 CLI).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add command-aware output-flag skipping for curl (-o/--output) and wget (-O/-OFILE/--output-document). Extract URLs from command+args instead of raw segment text to avoid matching URLs in env-prefix values. Add conservative non-TLD file extensions (.png, .jpg, .mp4, etc.) to schemeless host exclusion list. Fixes issue #33. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add license tier system, MCP dispatcher, and file scan modules. Replace silent `let _ =` error suppression with diagnostic eprintln messages in audit logging and CLI output writers.
# Conflicts: # crates/tirith-core/src/audit.rs # crates/tirith-core/src/extract.rs # crates/tirith/assets/shell/lib/bash-hook.bash # shell/lib/bash-hook.bash
- Merge origin/main (glibc fix, PowerShell panic fix, Chocolatey cleanup) - Fix single & segment boundary in split_raw_words (security) - Use exact match == "TIRITH=0" (prevents TIRITH=00 bypass) - Skip flags in resolve_command_wrapper - Remove dead code in is_tirith_command - Remove quote-stripping from is_env_assignment - Add sync_all before rename in receipt.rs - Move rename inside write success block in last_trigger.rs - Fix TOCTOU in doctor.rs reset_safe_mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolved 19 conflicts by keeping main's improved code. Replaced engine.rs with main's version to fix duplicate function definitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Test plan
🤖 Generated with Claude Code
Note
Adjust whitespace in security audit, license, MCP, and scan modules to address audit findings
Modify blank lines only across security audit, license, MCP, and scan modules.
📍Where to Start
Start with the primary entry point of the security audit module in security/audit/index.py.
Macroscope summarized d7a708e.