Repository navigation
Harden local review preflight against hidden Unicode control channels - #115
Open
d1vyanshu-kumar wants to merge 2 commits into
Open
d1vyanshu-kumar wants to merge 2 commits into
d1vyanshu-kumar wants to merge 2 commits into
Conversation
Author
|
Hey @mohsen1, this PR is ready for review when you have a moment. Here is a sc walkthrough showing a
|
This branch has not been deployed
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.

Threat model
Local review is a security boundary: source and paths are rendered to a human reviewer, a terminal, and downstream tooling before they are uploaded. Hidden Unicode can make the rendered representation materially differ from the byte sequence being reviewed. This includes bidirectional controls, Unicode Tags, selected zero-width characters, and variation-selector payload channels.
Change
<U+XXXX>markers in terminal annotations. Existing bidi-control sanitization remains intact.agent install; this fixes macOS/varversus/private/varpath inconsistency found by the end-to-end integration suite.Who benefits
Scope and trade-offs
The preflight examines only added patch lines and new paths. It intentionally does not rewrite raw JSON, MCP payloads, or SARIF message text: those are machine-readable channels where mutation could change payload semantics. An allow-path escape hatch does not waive stealth-Unicode findings.
Verification
Passed locally with the repository-pinned Rust 1.100.0 toolchain:
cargo fmt --checkcargo clippy --locked --all-targets -- -D warningscargo test --lockedcargo test --locked --all-targetsFocused coverage verifies detection before HTTP, diagnostics that do not echo raw hidden characters, removal-only remediation, hidden filenames, and hook warning/blocking modes.
cargo deny checkremains for GitHub Actions. This PR changes neither dependencies norCargo.lock.