Skip to content

Fix output path boundary validation#3611

Open
ShiroKSH wants to merge 1 commit into
getpelican:mainfrom
ShiroKSH:agent/fix-output-path-boundary
Open

Fix output path boundary validation#3611
ShiroKSH wants to merge 1 commit into
getpelican:mainfrom
ShiroKSH:agent/fix-output-path-boundary

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Jul 9, 2026

Copy link
Copy Markdown

What changed

  • Replace prefix-based output-path validation with normalized common-path checks.
  • Resolve symlinks before validating the boundary.
  • Keep the existing output path format and error behavior.
  • Add a regression test for sibling directories sharing the output prefix.
  • Add the required patch release metadata.

Why

A path such as ../output-evil/site.html could pass the old startswith check and be written outside the configured OUTPUT_PATH.

Validation

  • 270 tests passed, 28 skipped in the expanded suite.
  • Targeted sanitised_join tests: 4 passed.
  • Ruff check and format passed.
  • git diff --check passed.

The unfiltered Windows suite has seven pre-existing failures because a tracked symlink fixture is checked out as a text file without symlink privileges.

@ShiroKSH
ShiroKSH marked this pull request as ready for review July 9, 2026 21:28
@ShiroKSH

Copy link
Copy Markdown
Author

@justinmayer - could you take a look at the output path boundary fix in this PR when you have a chance, or route it to the right reviewer? I can make any requested changes or add tests. Thanks!

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