Repository navigation
fix(security): refuse the keys that make a child write a file - #2746
Merged
Merged
Conversation
Plan the change for #2674 and add the tests that fail on main: a caller override of SSLKEYLOGFILE, QLOGDIR, NODE_V8_COVERAGE, NODE_REDIRECT_WARNINGS or an LD_ key is not refused yet.
build_subprocess_env now refuses a caller override of SSLKEYLOGFILE, QLOGDIR, NODE_V8_COVERAGE, NODE_REDIRECT_WARNINGS and each LD_ key. Each raises the usual SecurityError, with isolation on and off. Why: probes with curl 8.23.0, git 2.55.0, Python 3.14, Node.js 24 and glibc 2.43 (temporary HOME, loopback only) made each child write a file that the caller names. SSLKEYLOGFILE wrote the TLS secrets of the connection. PYTHONDUMPREFSFILE and GPGRT_TRACE_FILE wrote no file in a probe, so they stay accepted. Plans #2674
Owner
Author
|
Targeted tests on the rebased branch (tests/test_subprocess_env_file_write.py, tests/test_subprocess_env_boundary.py, tests/test_subprocess_env_gh_kubectl.py): 610 passed. Fail-to-pass, The 4 tests that pass on base pin the accepted behavior: an isolated child gets none of the keys from the environment, a child without isolation gets them, and similar keys such as |
2 tasks done
dan-petty
marked this pull request as ready for review
October 30, 2026 01:50
dan-petty
pushed a commit
that referenced
this pull request
Oct 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.21.4](v0.21.3...v0.21.4) (2026-10-30) ### Bug Fixes * **ai:** name each prewarm server by host and port ([#2737](#2737)) ([2e2e4fa](2e2e4fa)), closes [#2676](#2676) * **ai:** the mcp benchmark tool takes no file path ([#2738](#2738)) ([5d5da15](5d5da15)), closes [#2704](#2704) * **config:** redact a removed credential in the config copies ([#2734](#2734)) ([f663344](f663344)), closes [#2645](#2645) * **rag:** name the Qdrant server by host and port ([#2733](#2733)) ([39aca9d](39aca9d)), closes [#2709](#2709) * **roadmap:** tick turn and kept diff for implement steps ([#2744](#2744)) ([890d2a6](890d2a6)), closes [#2721](#2721) * **security:** refuse the gh and kubectl keys that run a program ([#2732](#2732)) ([ad0bdf1](ad0bdf1)), closes [#2672](#2672) * **security:** refuse the keys that make a child write a file ([#2746](#2746)) ([1cd187e](1cd187e)), closes [#2674](#2674) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build_subprocess_envnow refuses a caller override of the keys that make a child write a file that the caller names:SSLKEYLOGFILE,QLOGDIR,NODE_V8_COVERAGE,NODE_REDIRECT_WARNINGSand eachLD_key. Each raises the usualSecurityError, with isolation on and off. An isolated child gets none of them from the environment.Why: probes with curl 8.23.0, git 2.55.0, Python 3.14.10, Node.js v24.22.2 and glibc 2.43 (temporary HOME, loopback only, a scratch directory) made each child write a file.
SSLKEYLOGFILEmade curl, git over HTTPS and the Pythonsslmodule write the TLS secrets of the connection, and a person who reads the file can decrypt the recorded traffic.QLOGDIRmade curl write a QUIC log.NODE_V8_COVERAGEmade Node.js write a coverage file, andNODE_REDIRECT_WARNINGSmade it write its warning to the named file.LD_DEBUG_OUTPUTandLD_PROFILE_OUTPUTmade the glibc loader write debug text and a profile, withLD_DEBUGandLD_PROFILE.The guard refuses the whole
LD_family with the patternLD_*, as the sudoenv_deletelist does and as the guard does forGIT_andSSH_. It replaces the four exactLD_names. No code of the repository sets anLD_key.PYTHONDUMPREFSFILEandGPGRT_TRACE_FILEstay accepted. No probe made a child write a file with them. The four new names sit in a block of their own inCONST_CODE_LOADING_ENV_PATTERNS. The Purpose of thesubprocess-environmentspec names the new kind of key.Change: openspec/changes/archive/2026-10-30-2674-refuse-file-write-env-keys/
Closes #2674