Skip to content

Fix: Prevent local file access via YAML path fields (path containment) - Closed due to inefficient fix#597

Closed
alpernae wants to merge 1 commit into
rendercv:mainfrom
alpernae:copilot/objective-guan
Closed

Fix: Prevent local file access via YAML path fields (path containment) - Closed due to inefficient fix#597
alpernae wants to merge 1 commit into
rendercv:mainfrom
alpernae:copilot/objective-guan

Conversation

@alpernae
Copy link
Copy Markdown

This PR fixes a local file access vulnerability where YAML path fields (e.g., cv.photo) could reference arbitrary absolute paths outside the input directory, leading to potential disclosure of sensitive files during rendering.

Key changes:

  • The path resolution logic in resolve_relative_path now enforces that all resolved paths must be contained within the input YAML's directory. Absolute or escaping paths are rejected.
  • Added a test (test_yaml_path_containment.py) to verify that paths outside the input directory are not allowed, and that valid relative paths within the directory are accepted.

Impact:

  • This closes the vulnerability where a crafted YAML could cause the renderer to access or copy arbitrary files from the host system.
  • The fix is enforced at the schema validation layer, so all downstream consumers are protected.

@alpernae
Copy link
Copy Markdown
Author

alpernae commented Dec 25, 2025

Closed due to inefficient fix

@alpernae alpernae closed this Dec 25, 2025
@alpernae alpernae changed the title Fix: Prevent local file access via YAML path fields (path containment) Fix: Prevent local file access via YAML path fields (path containment) - Closed due to inefficient fix Dec 25, 2025
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