Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artifact/template: make destination path absolute inside taskdir (0.12.7) #9150

Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented Oct 22, 2020

Backport of #9149 to 0.12.7

Prior to Nomad 0.12.5, you could use `${NOMAD_SECRETS_DIR}/mysecret.txt` as
the `artifact.destination` and `template.destination` because we would always
append the destination to the task working directory. In the recent security
patch we treated the `destination` absolute path as valid if it didn't escape
the working directory, but this breaks backwards compatibility and
interpolation of `destination` fields.

This changeset partially reverts the behavior so that we always append the
destination, but we also perform the escape check on that new destination
after interpolation so the security hole is closed.
@vercel
Copy link

vercel bot commented Oct 22, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hashicorp/nomad/6841upm3m
✅ Preview: https://nomad-git-b-template-artifact-destination-abs-path-0127.hashicorp.vercel.app

@tgross tgross changed the title artifact/template: make destination path absolute inside taskdir artifact/template: make destination path absolute inside taskdir (0.12.7) Oct 22, 2020
@tgross tgross merged commit f3a499b into release-0.12.7 Oct 22, 2020
@tgross tgross deleted the b-template-artifact-destination-abs-path-0.12.7 branch October 22, 2020 20:26
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants