Skip to content

Mount ownership pass follows symlinks while chowning as root #143

@nfebe

Description

@nfebe

The recursive bind-mount ownership pass runs as root and is re-applied after every deployment start, including over content the container wrote. It uses chown, which follows symlinks, so a container can plant a symlink inside its bind mount pointing at any host file and have it chowned to the container user on the next start. That is a privilege escalation from container to host.

Fix: chown the link itself (Lchown) during the recursive walk instead of resolving it, and skip symlink targets entirely.

Raised in review of #142.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions