Repository navigation
Security release. On Windows,
zn runin zn-gate 1.5.0 and earlier could pass secret values to a program chosen through the caller's environment when the approved command was a batch file. See GHSA-rf3f-ppm5-3xrx. Update withnpm install -g zn-gate@1.5.1.
Security release, mainly for Windows. Update with npm install -g zn-gate@1.5.1. The Python package has no code changes in this release.
Security
- Windows:
zn runstarts batch files through the system cmd.exe only. For a.cmdor.batprogram (for example an npm-installed CLI), the program that received the secret values could be chosen through the caller's environment. zn run now starts the system's cmd.exe, found through the system itself rather than any environment variable (/d /v:off /s /c, arguments passed verbatim), refuses to run the batch file if it cannot find it, and refuses a program path containing%,!or", which cmd.exe would expand. zn runremoves interpreter start-up variables (NODE_OPTIONS,NODE_PATH,PYTHONPATH,PYTHONHOME,PERL5OPT,PERL5LIB,RUBYOPT,RUBYLIB,JAVA_TOOL_OPTIONS,_JAVA_OPTIONS,JDK_JAVA_OPTIONS,BASH_ENV,ENVand similar) from the environment of an approved program when it hands over secret values, as it already did for dynamic loader variables. On Windows it also setsNoDefaultCurrentDirectoryInExePath=1for that program, so the programs it starts by name are not taken from the current directory.- Windows: the OpenCode plugin written by
zn hooks install opencode --projectstartsznwithNoDefaultCurrentDirectoryInExePath=1, so cmd.exe does not run azn.cmdplanted in the project directory instead of the installed zn. zn hooks install claude-codeno longer runs a batch-fileclaude(an npm install on Windows) through cmd.exe to register thesecretsMCP server; it prints the command to run instead (andclaude mcp removeon uninstall).- An API key that cannot be a zn key (anything but 16 to 256 letters, digits,
_,-and., such as a blank value or a placeholder a launcher left unexpanded) now counts as unset, soZN_CLOUD=1with such a value keeps prompt analysis local.
Known limitations
- Approving a batch file (
.cmd,.bat) for a secret inzn runapproves that file, not the programs it starts by name: an npm shim runs thenodefound on the caller'sPATH. Prefersecrets_http_requestfor HTTP APIs, or approve the program itself.
How to verify these files: docs/verify-release.md