Repository navigation
fix: don't pass hook variables' values on under other names - #6
Merged
Merged
Conversation
Co-authored-by: Vinícius <36349314+vrmiguel@users.noreply.github.com>
Co-authored-by: tembo[bot] <208362400+tembo-io[bot]@users.noreply.github.com>
…-inherited Co-authored-by: Vinícius <36349314+vrmiguel@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.
Variables in
hookEnvare never passed to servers, but a copy of the same value under another name still was. Agent harnesses commonly copy a platform token into several variables, for exampleTEMBO_API_TOKEN,OPENAI_API_KEYandANTHROPIC_API_KEY, so reserving one name didn't keep the token from stdio servers.Now a server also doesn't inherit any variable whose value exactly equals the (non-empty) value of a variable listed in
hookEnv. This applies toinheritEnvname lists too. Variables a server sets explicitly in its ownenvare still passed, since the config chose them. Variables that hooks merely reference, like a policy URL, aren't secrets, so their values can still be inherited under other names.This lets a config generator protect a token without knowing every name it's copied into, so Tembo's API can write gate's config statically. It stops accidental leaks, such as a server logging its environment or passing it to its own child processes. On its own it doesn't stop a server from reading gate's environment through
/proc; #8 fixes that on Linux.Tested by
hook_values_are_not_inherited_under_other_names, which fails without the change: the copy leaked through, and a copy of a hook URL was wrongly withheld.