mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-21 23:58:20 +08:00
HOME="${HOME:-$(eval echo ~"$USER")}" expands any shell metacharacters in
$USER when HOME is unset (CWE-78), e.g. USER='x"; <command>; "'. Validate the
username against a safe character set before running the eval and fall back
to $PWD for unsafe values. Also quote $USER in the getent call to avoid word
splitting.
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>