Daemons that care about security setuid temporarily before opening a file and then setuid back
Re:Git security vulnerability announced
by jra_samba on Wednesday April 13, 2022 @06:38PM
(#31021195)
That doesn't always fix it. An attacker can race you to make you write something in a place you didn't intend or expect unless the application is incredibly carefully written.
And by "incredibly" I mean beyond the scope of human endeavour :-).
You can sort of think of a symlink as having 2 owners: the user that owns the symlink itself, and the user who owns the file pointed to by the symlink. One of those owners might be an attacker, so every time you interact with a file, you have to think "this file might be half-owned by an attacker, and half-owned by a victim".