# Tilde in PATH Security: How Quoted Tildes Cause Relative Execution

DevFeed: [Tilde in PATH Security: How Quoted Tildes Cause Relative Execution](<https://devfeed.tech/articles/tilde-in-path-security-how-quoted-tildes-cause-relative-execution-84714.md>)

Original publisher: [Read original article](<https://www.sitepoint.com/tilde-in-path-security-fix/>)

Author: SitePoint Team

Published: 2026-10-11T15:40:55Z

Content type: tutorial

Language: en

Sources: [SitePoint](<https://devfeed.tech/sources/sitepoint.md>)

Topics: [Security](<https://devfeed.tech/topics/security.md>), [Shell](<https://devfeed.tech/topics/shell.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [engineering-culture](<https://devfeed.tech/topics/engineering-culture.md>)

Tags: [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [programming](<https://devfeed.tech/tags/programming.md>), [security](<https://devfeed.tech/tags/security.md>), [shell](<https://devfeed.tech/tags/shell.md>), [shell-configuration](<https://devfeed.tech/tags/shell-configuration.md>), [web-security](<https://devfeed.tech/tags/web-security.md>)

## AI overview

The article explains how quoting `~` in PATH assignments can leave a literal, relative path entry that may allow a planted executable to run when PATH order and the current working directory align. It describes shell-specific behavior, audit commands for PATH and configuration files, and replacing quoted tildes with `$HOME`.

## Source excerpt

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.