Skip to content

Add invisible character hardening: Unicode Tags, variation selectors, math operators#44

Merged
sheeki03 merged 13 commits intomainfrom
feat/part2-invisible-char-hardening
Feb 24, 2026
Merged

Add invisible character hardening: Unicode Tags, variation selectors, math operators#44
sheeki03 merged 13 commits intomainfrom
feat/part2-invisible-char-hardening

Conversation

@sheeki03
Copy link
Owner

@sheeki03 sheeki03 commented Feb 24, 2026

Summary

  • Add detection for Unicode Tags (U+E0001-E007F), supplementary variation selectors, math operators, and additional whitespace characters
  • Replace silent error suppression with diagnostic messages
  • Add exec fixtures for invisible char edge cases
  • Fix tier-1 coverage safeguard to check allow fixtures with expected rules
  • Includes Part 1 (Info severity + HTTPie) and bug fixes

Test plan

  • All existing tests pass

🤖 Generated with Claude Code

Note

Emit Unix permission warnings in tirith_core::runner::run and make Bash safe-mode persistence non-fatal to support invisible character hardening

Adds stderr warnings when setting cached file permissions fails in crates/tirith-core/src/runner.rs and refactors Bash safe-mode persistence to continue on mkdir/write failure in crates/tirith/assets/shell/lib/bash-hook.bash and shell/lib/bash-hook.bash.

📍Where to Start

Start with the Unix-specific block in tirith_core::runner::run in crates/tirith-core/src/runner.rs, then review _tirith_persist_safe_mode in crates/tirith/assets/shell/lib/bash-hook.bash.

Macroscope summarized 9dd6468.

sheeki03 and others added 8 commits February 21, 2026 13:58
push_segment() incorrectly treated VAR=VALUE as the command token. Now
skips leading environment variable assignments to find the real command.
Adds pub is_env_assignment() helper for use by engine bypass detection.

Fixes: TIRITH=0 curl evil.com now correctly identifies curl as command.

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>
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>
…paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace `let _ =` patterns with `if let Err(e)` + eprintln in audit
logging, CLI output writers, last_trigger file ops, runner permissions,
and bash hook safe-mode persistence. Errors are now surfaced to stderr
instead of silently swallowed.
- Run cargo fmt --all
- Fix clippy lints: collapsible else-if in check.rs, uninlined_format_args
- Add .cargo/audit.toml ignoring RUSTSEC-2026-0009 (time crate DoS,
  not exploitable in our usage, fix requires Rust 1.88)
- Add same ignore to deny.toml
sheeki03 and others added 4 commits February 24, 2026 22:56
- Merge origin/main (glibc build fix)
- Fix single & segment boundary in split_raw_words (security)
- Use exact match == TIRITH=0 (prevents false bypass)
- Skip flags in resolve_command_wrapper
- Remove dead code in is_tirith_command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nd -v fix

Resolves conflicts in engine.rs and tokenize.rs by taking main's
improved code: quoted-value bypass detection, command-word requirement,
PowerShell $env:TIRITH support, and command -v/-V lookup exclusion.
Keeps PR's invisible character hardening (unicode tags, variation
selectors, math operators, invisible whitespace).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts in deny.toml and last_trigger.rs by taking main's versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sheeki03 sheeki03 merged commit a675138 into main Feb 24, 2026
9 checks passed
@sheeki03 sheeki03 deleted the feat/part2-invisible-char-hardening branch February 24, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant