Skip to content

Enforce mode/ownership on /tmp/pwrap<uid> runtime dir #14

@haard

Description

@haard

vault.py::_runtime_dir does d.mkdir(mode=0o700, exist_ok=True). If another user on the host pre-creates /tmp/pwrap-<your-uid> with looser perms, we silently adopt it — /tmp is sticky-world-writable, so this is reachable by any local user.

Preferred fix: use $XDG_RUNTIME_DIR (per-user /run/user/<uid>, 0700 by default, cleaned on logout).

Fallback if staying in /tmp: stat after mkdir and refuse if owner != geteuid() or mode is wider than 0o700. Fail fast with a clear error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity issue - makes pwrap less safe to use

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions