Skip to content

Conversation

@jrasell
Copy link
Member

@jrasell jrasell commented Oct 28, 2025

If a task is named "alloc" the filesystem security guarantees for the allocation are broken. It allows any other task in the allocation to access the task directory for the task named "alloc". This is because the impacted tasks directory name mimics the allocation directory name which all tasks have access to.

Fix this by disallowing "alloc" as a name for a task and return an error to the job submitter.

Links

Closes #26999
Jira https://hashicorp.atlassian.net/browse/NMD-1056

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

If a task is named "alloc" the filesystem security guarantees for
the allocation are broken. It allows any other task in the
allocation to access the task directory for the task named
"alloc". This is because the impacted tasks directory name mimics
the allocation directory name which all tasks have access to.

Fix this by disallowing "alloc" as a name for a task and return
an error to the job submitter.
@jrasell jrasell added backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/ent/1.9.x+ent Changes are backported to 1.9.x+ent backport/1.10.x backport to 1.10.x release line labels Oct 28, 2025
@jrasell jrasell marked this pull request as ready for review October 28, 2025 17:15
@jrasell jrasell requested review from a team as code owners October 28, 2025 17:15
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrasell jrasell merged commit 0ab218f into main Oct 29, 2025
49 checks passed
@jrasell jrasell deleted the b-NMD-1056 branch October 29, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/ent/1.9.x+ent Changes are backported to 1.9.x+ent backport/1.10.x backport to 1.10.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Naming a task alloc is bad but allowed

3 participants