Skip to content

Add environment variable and network destination detection#46

Merged
sheeki03 merged 12 commits intomainfrom
feat/part4-env-network-detection
Feb 24, 2026
Merged

Add environment variable and network destination detection#46
sheeki03 merged 12 commits intomainfrom
feat/part4-env-network-detection

Conversation

@sheeki03
Copy link
Owner

@sheeki03 sheeki03 commented Feb 24, 2026

Summary

  • Add detection for suspicious environment variable modifications
  • Add network destination policy enforcement
  • Fix review findings: bare-IP tier-1 gating, host validation, Fish set handler, error handling
  • Includes Parts 1-3 and bug fixes

Test plan

  • All existing tests pass

🤖 Generated with Claude Code

Note

Treat environment variable names case-insensitively in rules::command.classify_env_var in command.rs to support environment variable and network destination detection

Add ASCII uppercasing of the input name before membership checks in rules::command.classify_env_var in command.rs.

📍Where to Start

Start with rules::command.classify_env_var in command.rs.

Macroscope summarized a320896.

sheeki03 and others added 8 commits February 18, 2026 20:17
… handler, error handling

- Add private_network_ip tier-1 pattern in build.rs for bare IPs without scheme
- Add host validation in extract_host_from_arg (reject empty, /, [ hosts)
- Fix Fish set handler to collect value parts instead of empty string
- Add bare-IP private network fixture and update no_url_rules safeguard
- Improve audit.rs error handling: log failures instead of silently ignoring
- Fix collapsible else-if clippy lint in check.rs
- Improve error reporting in run.rs and score.rs JSON output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
- Run cargo fmt --all
- Fix uninlined_format_args clippy lints in cli_integration tests
- 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 2 commits February 24, 2026 22:59
- 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>
Resolved 18 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>
@sheeki03 sheeki03 merged commit 47b61d8 into main Feb 24, 2026
9 checks passed
@sheeki03 sheeki03 deleted the feat/part4-env-network-detection 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