Skip to content

Security Improvement: Do not pass internal environment variables to external commands #19455

Open

Description

@bilberry-work

Basics

  • 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.

Additional context and details

No response

Activity

  1. added
    category:enhancement
    status:needs-triage
    on Nov 5, 2026
  2. WindSoilder commented on Nov 6, 2026

    @WindSoilder
    Contributor

    Relative: #15533
    I agree it'd be necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:enhancementstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions