security(linker): reject unsafe package aliases#800
Conversation
Greptile SummaryThis PR adds defense-in-depth validation that rejects unsafe package/dependency aliases before they can be used to build paths under
Confidence Score: 5/5Safe to merge. All three linker paths validate names before constructing filesystem paths, error propagation is correctly threaded through the call chain, and the only caller of the updated The validation logic correctly blocks all practical path-traversal shapes. The No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(linker): surface unsafe hoisted name..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f3e22aa. Configure here.
|
Addressed the review feedback in
Local checks run:
This comment was generated by Codex. |

Summary
Tests
This PR was generated by Codex.
Note
Medium Risk
Security-hardening on install/link paths can fail installs if lockfiles contain unusual dependency keys that previously linked; behavior is intentional fail-closed.
Overview
Adds defense-in-depth so only valid npm
node_modulesslot names (nameor@scope/name) are used when building paths undernode_modules.A new
validate_package_link_namehelper rejects path-like aliases (.., extra slashes, absolute paths, Windows drive prefixes, null bytes, etc.). It runs during materialize (package name and dependency keys), isolated top-level and workspace symlinks, and hoisted placement planning. Hoisted planning andHoistedPlacements::from_graphnow returnResultso unsafe names fail install/rebuild instead of silently planning bad paths.Registers
ERR_AUBE_UNSAFE_PACKAGE_NAME(exit code 92) inaube-codes, linker diagnostics, anddocs/error-codes.data.json, alongside unit tests for accepted and rejected names.Reviewed by Cursor Bugbot for commit 9072c5c. Bugbot is set up for automated code reviews on this repo. Configure here.