Quoting a tilde in PATH suppresses expansion, creating a literal ‘~’ entry that resolves relative to the current working directory. If an attacker can write to that relative path and PATH search order reaches it, the shell executes the foreign binary. Here is how to audit your shell configuration and replace literal tildes with $HOME.
Continue reading
Tilde in PATH Security: How Quoted Tildes Cause Relative Execution
on SitePoint.
