Repository navigation
return BreakoutError when symlink does not link to a path inside the destination - #9486
Merged
Merged
Conversation
…destination Added tests to verify this behaviour for hard links and symlinks. Thankfully it is not easy to exploit this code path within Concourse. This code gets called in two scenarios: - When fly downloads outputs from a `fly execute --output` build - When baggageclaim streams a volume in (Windows/macOS workers only) Neither case has an easy path to exploit. In the first case, you'd have to trick the user into running a malicious Task config which would create an output volume with the goal of overwriting a specific file on the users' system. This would require the attacker knowing the directory the user will run `fly execute` in and what file the attacker wants to overwrite. The user also has to include the correct output in `--output` in the `fly execute` command. If the user can be socially engineered to run an arbitrary task on their Concourse system, the attacker could just as easily get the user to execute a simple bash script instead. The external CI system is also potentially a better target than the users' system. In the second case, you'd have to already have access to run arbitrary workloads on the Concourse worker or some way to craft a volume that will then be streamed to a Windows or macOS worker. This would involve intimiate knowledge of the target pipeline and would likely mean the attacker can modify the pipeline to do whatever they want, which would make this exploit moot to the attacker. Signed-off-by: Taylor Silva <[email protected]>
aliculPix4D
added a commit
to Pix4D/concourse-tar-streaming-issue
that referenced
this pull request
Jun 9, 2026
aliculPix4D
added a commit
to Pix4D/concourse-tar-streaming-issue
that referenced
this pull request
Jun 9, 2026
aliculPix4D
added a commit
to Pix4D/concourse-tar-streaming-issue
that referenced
this pull request
Jun 9, 2026
aliculPix4D
added a commit
to Pix4D/concourse-tar-streaming-issue
that referenced
this pull request
Jun 9, 2026
aliculPix4D
added a commit
to Pix4D/concourse-tar-streaming-issue
that referenced
this pull request
Jun 9, 2026
aliculPix4D
added a commit
to Pix4D/concourse-tar-streaming-issue
that referenced
this pull request
Jun 9, 2026
This was referenced Jun 10, 2026
taylorsilva
added a commit
that referenced
this pull request
Jun 15, 2026
Basically reverting #9486, but adding one safe-guard against path escapes from symlinks when creating a relative symlink. `os.Root` is doing the heavy-lifting for us here. It'll protect us from extraction attacks that try to write outside the destination directory. Signed-off-by: Taylor Silva <[email protected]>
taylorsilva
added a commit
that referenced
this pull request
Jun 15, 2026
Basically reverting #9486, but adding one safe-guard against path escapes from symlinks when creating a relative symlink. `os.Root` is doing the heavy-lifting for us here. It'll protect us from extraction attacks that try to write outside the destination directory. Signed-off-by: Taylor Silva <[email protected]>
taylorsilva
added a commit
that referenced
this pull request
Jun 15, 2026
Basically reverting #9486, but adding one safe-guard against path escapes from symlinks when creating a relative symlink. `os.Root` is doing the heavy-lifting for us here. It'll protect us from extraction attacks that try to write outside the destination directory. Signed-off-by: Taylor Silva <[email protected]>
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed by this PR
Issue reported to [email protected] by @SnailSploit
Added tests to verify this behaviour for hard links and symlinks.
Thankfully it is not easy to exploit this code path within Concourse. This code gets called in two scenarios:
fly execute --outputbuildNeither case has an easy path to exploit.
In the first case, you'd have to trick the user into running a malicious Task config which would create an output volume with the goal of overwriting a specific file on the users' system. This would require the attacker knowing the directory the user will run
fly executein and what file the attacker wants to overwrite. The user also has to include the correct output in--outputin thefly executecommand. If the user can be socially engineered to run an arbitrary task on their Concourse system, the attacker could just as easily get the user to execute a simple bash script instead. The external CI system is also potentially a better target than the users' system.In the second case, you'd have to already have access to run arbitrary workloads on the Concourse worker or some way to craft a volume that will then be streamed to a Windows or macOS worker. This would involve intimiate knowledge of the target pipeline and would likely mean the attacker can modify the pipeline to do whatever they want, which would make this exploit moot to the attacker.