Repository navigation
Harden Kiro CLI path resolution - #25
Conversation
|
Requesting changes before merge: This PR removes PATH lookup entirely (which::which() calls removed), which regresses Kiro detection on WSL/Linux environments where the CLI may be installed in a non-standard location. Please restore PATH-based discovery with the same hardening pattern used in PR #26 (check if path is explicit vs bare command name). |
The PR removed PATH-based discovery entirely, which regressed Kiro detection on WSL/Linux where the CLI may be in a non-standard location. This restores which::which() lookups with the same hardening pattern used in PR #26: 1. Check env override first (explicit path) 2. Hardened PATH lookup (which::which + is_allowed_kiro_binary validation) 3. Fall back to known Windows install locations This maintains the security hardening while preserving cross-platform compatibility.
|
Fixed: Restored hardened PATH lookup for WSL/Linux support. The Problem: The Fix (commit 2fcfd4a):
This maintains security (validated filenames, env override priority) while restoring cross-platform compatibility. Security preserved:
The PR should now be safe to merge. |
Security fixes: - Harden updater integrity checks (PR #24) - Harden CLI binary resolution (PR #26) - Harden Kiro CLI path resolution (PR #25) - Verify VC++ runtime before packaging (PR #23) New provider: - Add Infini AI Coding Plan provider (PR #28) Bug fixes: - Fix Windows CLI visibility (Issue #22) - Fix Claude .local/bin detection (Issue #22)
Security fixes: - Harden updater integrity checks (PR #24) - Harden CLI binary resolution (PR #26) - Harden Kiro CLI path resolution (PR #25) - Verify VC++ runtime before packaging (PR #23) New provider: - Add Infini AI Coding Plan provider (PR #28) Bug fixes: - Fix Windows CLI visibility (Issue #22) - Fix Claude .local/bin detection (Issue #22)
Motivation
kiro-clivia PATH (e.g.whichor env resolution), which allows a local PATH-hijack to execute attacker-controlled binaries under the user context.Description
CODEXBAR_KIRO_CLI_PATHand a filename/path validatoris_allowed_kiro_binaryinrust/src/providers/kiro/version.rsto allow only explicit, trusted Kiro CLI paths.find_kiro_cli()that only accepts the env override or known Windows install locations and validates discovered files before returning them.KiroProvider::which_kiro()inrust/src/providers/kiro/mod.rsto reuseversion::find_kiro_cli()so the login and usage execution paths use the same hardened resolver.detect_version,get_version,is_installed) while removing untrustedwhichlookups.Testing
cd rust && cargo fmt --all— succeeded.cd rust && cargo test --quiet— failed in this environment due to missingx86_64-pc-windows-msvctarget, so tests could not be executed here.cd rust && cargo test -p codexbar --lib providers::kiro::version::tests::test_parse_version_simple— failed because the package has no library target in this workspace configuration.cd rust && cargo check --target x86_64-unknown-linux-gnu --quiet— failed here due to missing nativeglib-2.0(pkg-config) system dependency, so further automated verification could not complete in this environment.Codex Task