#10190 fix(core): Prevent include_paths from escaping project root (#10182)
Pull request opened by
edgarrmondragon
Description
Checklist
• I have read the
contribution guide
Was generative AI tooling used to co-author this PR?
• Yes (please specify the tool below)
Related Issues
• Closes #XXXX
Summary by Sourcery
Enforce that project include_paths and the primary meltano.yml stay within the project root and represent actual files, preventing path traversal and other invalid configurations.
Bug Fixes:
• Reject meltano.yml locations outside the project root when constructing ProjectFiles.
• Validate include_paths matches as real files within the project root and exclude the root meltano.yml itself from inclusion.
• Prevent include_paths from following directory, relative, or symlink-based paths that escape the project root, ensuring included files cannot modify external configurations.
Enhancements:
• Introduce stronger typing around in-project file paths to centralize trust boundaries for reading and writing project files.
• Refine logging messages and internal mappings for project file tracking to use structured data rather than raw string paths.
Tests:
• Add tests covering invalid meltano.yml roots, malformed include YAML, self-inclusion, non-file include paths, and both direct and symlink-based path traversal attempts via include_paths.
meltano/meltano