Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 21, 2026

Description

This PR addresses a security issue where search path canonicalization failures were silently ignored. Previously, if std::fs::canonicalize failed (e.g., due to a broken symlink or non-existent path), the code fell back to using the original raw path. This could allow operations on invalid or unverified paths.

Changes

  • Modified src/core/search.rs to propagate the error from std::fs::canonicalize instead of suppressing it with unwrap_or_else.

Verification

  • Reproduced the issue with a script that used a broken symlink.
  • Verified that with this fix, the operation returns an error as expected instead of proceeding with the broken path.
  • Ran existing tests (cargo test) to ensure no regressions.

Previously, canonicalize() failures were silently ignored, falling back to the potentially invalid or malicious path. This commit removes the silent fallback and propagates the error, ensuring that searches do not proceed with invalid paths.
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.

2 participants