Skip to content

Shell subprocess inherits sensitive environment variables causing credential exposure #6601

Description

@jadelike-wine

What happened?

Shell subprocesses spawned by Qwen Code inherit the full daemon process environment via process.env.

Sensitive environment variables such as QWEN_SERVER_TOKEN, API keys, and other credentials may be exposed to shell commands executed by the agent.

For example:

printenv QWEN_SERVER_TOKEN

can reveal sensitive environment variables because the shell execution path does not remove secrets before spawning child processes.

The current behavior is inconsistent with other child process spawning paths that already sanitize sensitive environment variables.

What did you expect to happen?

Shell subprocesses should not inherit sensitive credentials from the Qwen Code daemon environment.

Sensitive environment variables such as tokens, API keys, secrets, and credentials should be removed before launching shell commands.

Shell execution should follow the same security practice as other child process creation paths.

Client information

Client Information

Run qwen to enter the interactive CLI, then run the /about command.

Qwen Code v0.19.8
Model: (OpenAI-compatible API)
Auth: openai
Platform: darwin arm64 (24.6.0)
Node.js: v24.3.0
Git commit: 34b1a8324
LSP: disabled

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions