Skip to content

Conversation

taylorsilva
Copy link
Member

@taylorsilva taylorsilva commented Feb 20, 2025

Changes proposed by this PR

The behaviour of this was changed back in 7.5.0 by #6597 (2ba0164) and was never properly captured in our release notes. It kinda snuck in with everything else in that PR.

Previously only relative paths were allowed. No tests were added to handle these new cases. In testing this I also found that paths with parent directories were also allowed and would work; You'd get the input mounted above the task's CWD. This seems like a bad thing to encourage so I've locked things down to only allow absolute and relative paths. Allowing parent directories seems like an easy footgun for users to fall onto.

We now have test coverage for:

  • Allowing absolute paths in task inputs/outputs
  • Ignoring paths with parent directory references in them

Release Note

  • Task inputs and outputs can be placed using absolute or relative paths inside task containers now. This was changed back in v7.5.0 (Simplify atc/worker package and extract runtime abstractions #6597) but never properly announced. Paths that reference parent directories (../) will be treated as relative paths and no parent directory traversal will occur.

The behaviour of this was changed back in 7.5.0 by
#6597

Previously only relative paths were allowed. No tests were added to
handle these new cases. In testing this I also found that paths with
parent directories were also allowed and would work. You'd get the input
mounted above the task's CWD. This seems like a bad thing to encourage
so I've locked things down to only allow absolute and relative paths.
Allowing parent directories seems like an easy footgun for users to fall
onto.

We now have test coverage for:
- Allowing absolute paths in task inputs/outputs
- Ignoring paths with parent directory references in them

Signed-off-by: Taylor Silva <dev@taydev.net>
@taylorsilva taylorsilva requested a review from a team as a code owner February 20, 2025 18:54
@taylorsilva taylorsilva changed the title ignore paths that reference parent directories atc: exec: ignore task input/output paths that reference parent directories Feb 20, 2025
@taylorsilva taylorsilva merged commit c7f3794 into master Feb 21, 2025
11 checks passed
@taylorsilva taylorsilva deleted the update-task-input-path-handling branch February 21, 2025 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant