Skip to content

fix(exec): enforce permissions for non-root exec user#1381

Closed
KevinSailema wants to merge 1 commit intoapple:mainfrom
KevinSailema:fix/1352-exec-permissions
Closed

fix(exec): enforce permissions for non-root exec user#1381
KevinSailema wants to merge 1 commit intoapple:mainfrom
KevinSailema:fix/1352-exec-permissions

Conversation

@KevinSailema
Copy link
Copy Markdown

Drop elevated process capabilities when exec is requested with an explicit non-root user.

Add a CLI regression test that validates /etc/shadow access is denied for exec -u nobody.

Refs: #1352

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Issue #1352 reports that container exec with an explicit non-root user could still read privileged files such as /etc/shadow.
Although uid and gid were switched correctly, elevated process capabilities were still effectively allowing access.
This change drops elevated capabilities when exec is requested with an explicit non-root user, so file permission checks follow expected Unix and Docker semantics.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Drop elevated process capabilities when exec is requested with an explicit non-root user.

Add a CLI regression test that validates /etc/shadow access is denied for exec -u nobody.

Refs: apple#1352
@dcantah
Copy link
Copy Markdown
Member

dcantah commented Apr 2, 2026

This is not the right fix, we just need caps support in this project in general. We're working to get this out shortly.

@dcantah dcantah closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants