Skip to content

fix(repopo): harden repo-bound path handling - #665

Open
tylerbutler wants to merge 2 commits into
mainfrom
repopo-path-hardening
Open

tylerbutler wants to merge 2 commits into
mainfrom
repopo-path-hardening

Conversation

@tylerbutler

Copy link
Copy Markdown
Owner

Summary

  • harden path handling with new safe path utilities to keep file access inside repo root
  • validate and normalize file input paths in repopo check (including --stdin)
  • apply root-bound path resolution in package/file-header policy definers
  • add traversal regression tests and a changeset entry

Validation

  • NX_TUI=false pnpm nx run repopo:build --outputStyle=static
  • NX_TUI=false pnpm nx run repopo:test:vitest --outputStyle=static (586 tests passed)
  • NX_TUI=false pnpm nx run repopo:check --outputStyle=static
  • NX_TUI=false pnpm nx run repopo:lint --outputStyle=static

Notes

  • full pnpm nx run repopo:test remains blocked by a pre-existing repopo:test:snapshots mismatch related to check-native runtime flag snapshots (not introduced by this change).

Add centralized safe path utilities, validate stdin paths in check, and enforce root-bound file access in policy definers. Also adds traversal regression tests and a changeset entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Mar 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2722142

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
repopo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Mar 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.00000% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/repopo/src/commands/check.ts 0.00% 18 Missing ⚠️
packages/repopo/src/utils/safePaths.ts 96.15% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@nx-cloud

nx-cloud Bot commented Jul 20, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 2722142

Command Status Duration Result
nx affected -t ci ❌ Failed 10s View ↗

💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗.


☁️ Nx Cloud last updated this comment at 2026-07-20 03:41:27 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant