Repository navigation
fix(lint): refuse symlinks so --fix cannot write outside the repo - #67
Merged
Merged
Conversation
A committed symlink under docs/ was followed by lint --fix, so an order file or page rewrite could modify a file outside the repository. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
[Medium impact] The PR appears safe to merge; no new blocking issue was found. Reviews (3) · Last reviewed commit: "fix: rebuild the gha dist" · Reviewed by Greptile |
…hecks A dangling page symlink was still handed to links, which threw ENOENT, and a linked custom_blocks/ directory was skipped with no error. Co-authored-by: Cursor <cursoragent@cursor.com>
greptile-apps
Bot
dismissed
their stale review
November 11, 2026 00:30
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
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.
Summary
readme lint --fixfollowed committed symlinks and wrote the file they pointed at. A symlinked_order.yamlcould gain- <slug>lines or lose existing-lines, and a symlinked page could have unknown frontmatter keys renamed tox-<key>. A symlinkeddocs/directory was the same hole one level up.The ordering walk now refuses a symlink before it reads the directory or the order file, and it does not queue a fix for that path.
collectFilesdoes not list a linked content root, so that directory is one ordering error rather than one error per child. With--fix, each page is checked once at open; a symlinked page is reported and skipped, so frontmatter never rewrites it.PathEscapeErrornames the path under the base the caller passed, sopath.relativestays inside the repo when that base is reached through a symlink such as/var→/private/var.Fixes RM-19517.
Test plan
npx vitest run test/security/lint-fix-symlink.test.js test/utils/containment.test.js test/validators/ordering.test.js test/validators/frontmatter.test.js test/validators/oas-reference.test.js_order.yaml:--fixappends nothing and does not delete existing-lines. The target file is unchanged and the link is still a symlink.docs/: one ordering error, and files inside the target are not rewritten.x-<key>.x-<key>.Made with Cursor