Skip to content

docs: add security warning for ZX_PREFIX and ZX_POSTFIX env variables#1450

Open
Shreyansh-Kushwaha wants to merge 1 commit intogoogle:mainfrom
Shreyansh-Kushwaha:docs-zx-prefix-warning
Open

docs: add security warning for ZX_PREFIX and ZX_POSTFIX env variables#1450
Shreyansh-Kushwaha wants to merge 1 commit intogoogle:mainfrom
Shreyansh-Kushwaha:docs-zx-prefix-warning

Conversation

@Shreyansh-Kushwaha
Copy link
Copy Markdown

Resolves #1435

What does this PR do?

This PR adds a security warning to the documentation regarding the use of ZX_PREFIX, ZX_POSTFIX, and ZX_SHELL environment variables.

As highlighted in issue #1435, because these variables are injected globally into every command executed via the $ template tag without sanitization, they represent a potential silent command injection surface. While this behavior is highly useful for parameterization in CI/CD and containerized environments, it wasn't explicitly documented as a security boundary.

Changes made:

  • Added a > [!WARNING] callout in docs/cli.md under the Environment variables section.
  • Added a > [!WARNING] callout in docs/configuration.md under the $.prefix section.

These notes ensure developers are explicitly aware of the risks when using untrusted environment variables in shared or automated environments.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Apr 1, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ZX_PREFIX / ZX_POSTFIX allow implicit global command injection via environment variables

1 participant