You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security Improvement: Do not pass internal environment variables to external commands #19455
I have done a basic search through the issue tracker to find similar or related issues.
I have made myself familiar with the available features of Nushell for the particular area this enhancement request touches.
Related problem
When invoking an external command, nu passes several environment variables to the newly invoked process.
This is a potential security flaw, similar in nature to that which affected bash about 10 years ago.
Variables I have seen passed include:-
CMD_DURATION_MS
LAST_EXIT_CODE
NU_VERSION
PROMPT_INDICATOR
PROMPT_INDICATOR_VI_INSERT
PROMPT_INDICATOR_VI_NORMAL
PROMPT_MULTILINE_INDICATOR
Describe the solution you'd like
By default, any environment passed to an external command should be just the environment inheritated by the shell and any environment variables explicitly set using with-env, etc; the shell should be silent.
Describe alternatives you've considered
I have written my own external-command custom command wrapper, but this loses the ability to then use --wrapped definitions without creating boilerplate.
Activity
WindSoilder commentedon Nov 6, 2026
Relative: #15533
I agree it'd be necessary