hashicorp / hashicorp/nomad

bug report: Nomad modifies executable permissions

Open
#18,441 3 comments 0 reactions 0 assignees View on GitHub
stage/needs-discussion theme/docs theme/driver/exec theme/driver/java theme/driver/raw_exec type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
1.6.1

### Operating system and Environment details
Archlinux Latest

### Issue
https://github.com/hashicorp/nomad/blob/main/drivers/shared/executor/executor.go#L342C21-L342C21 modifies executable permissions. If executable has no permissions, it should not be executed, not modified.

### Reproduction steps

```
$ cp /usr/bin/sudo ./sudo
$ chmod go-rwx ./sudo
$ stat ./sudo
File: ./sudo
Size: 248912 Blocks: 488 IO Block: 4096 regular file
Device: 0,37 Inode: 71806 Links: 1
Access: (0700/-rwx------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-09-11 09:12:33.918894421 +0200
Modify: 2023-09-11 09:12:33.918894421 +0200
Change: 2023-09-11 09:12:40.865412090 +0200
$ cat >test_raw_exec.nomad.hcl <

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading drivers/shared/executor/executor.go at the referenced line and run the supplied raw_exec reproduction with the Nomad job file. Done means executing the file leaves its original 0700 permissions unchanged rather than changing them to 0755; verify this with stat after the run.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.