Skip to content

Reject absolute paths and symlinks in LocalFetcher parent traversal#3

Merged
andrew merged 1 commit intomainfrom
fix/local-path-traversal
May 2, 2026
Merged

Reject absolute paths and symlinks in LocalFetcher parent traversal#3
andrew merged 1 commit intomainfrom
fix/local-path-traversal

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented May 2, 2026

`LocalFetcher.walk` follows `` declarations to resolve parent POM chains on the filesystem. A hostile `` set to an absolute path or pointing through a symlink could redirect reads outside the project tree.

Now rejects absolute `` values outright and uses `os.Lstat` to skip symlinks at each step of the walk, including when the path resolves to a directory and `pom.xml` is appended.

LocalFetcher.walk follows <relativePath> from POM files to resolve
parent chains. Absolute paths and symlinks could redirect reads
outside the project tree. Now rejects absolute <relativePath> values
and uses os.Lstat to skip symlinks at each step.
@andrew andrew force-pushed the fix/local-path-traversal branch from 356c1cd to 3c97861 Compare May 2, 2026 15:16
@andrew andrew merged commit b2e4cce into main May 2, 2026
2 checks passed
@andrew andrew deleted the fix/local-path-traversal branch May 2, 2026 15:18
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.

1 participant