Skip to content

More safe per-user location for temp files for single-file-apps? #35221

@omajid

Description

@omajid

This is a comment on #2329:

It seems like $TMPDIR is only system-wide on Linux. Both macOS and Windows have a user-specific temp.

So, for Linux, can you help me understand why we are using an error prone approach where /tmp/.net (with a predictable name, susceptible to collisions and other attacks) is used? Wouldn't it be more secure to fall back to a user-specific path? $XDG_CACHE_HOME (falling back to $HOME/.cache/) seems like a location that would be much less susceptible attacks and accidental clashes.

Also, most recent distributions treat /tmp as temporary. systemd, for example, wipes things older than 10 days on /tmp/ on my machine. Compare this with the persistent $HOME/.cache. On the other hand, if we want things cleaned up, using the more secure /run/user/$UID (created on user login, secure without races) seems like the better way to go.

cc @tmds @swaroop-sridhar @jkotas @lpereira @danmosemsft

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions