@@ -49,8 +49,9 @@ describe("resolveMcpTransportConfig", () => {
4949 } ) ;
5050
5151 it ( "drops dangerous env overrides from stdio config" , ( ) => {
52- // Stdio env is executable process input. Block loader/shell hook variables
53- // while preserving ordinary provider tokens and scalar env values.
52+ // Stdio env is inherited executable process input. Block loader/shell hook
53+ // variables and child-process config pivots while preserving explicit MCP
54+ // credentials and ordinary scalar env values.
5455 const resolved = resolveMcpTransportConfig ( "probe" , {
5556 command : "node" ,
5657 env : {
@@ -62,6 +63,8 @@ describe("resolveMcpTransportConfig", () => {
6263 NODE_OPTIONS : "--require=./evil.js" ,
6364 LD_PRELOAD : "/tmp/pwn.so" ,
6465 BASH_ENV : "/tmp/pwn.sh" ,
66+ ANSIBLE_CONFIG : "/tmp/evil-ansible.cfg" ,
67+ TF_CLI_CONFIG_FILE : "/tmp/evil-terraform.rc" ,
6568 } ,
6669 } ) ;
6770
@@ -92,6 +95,12 @@ describe("resolveMcpTransportConfig", () => {
9295 expect ( logWarn ) . toHaveBeenCalledWith (
9396 'bundle-mcp: server "probe": env "BASH_ENV" is blocked for stdio startup safety and was ignored.' ,
9497 ) ;
98+ expect ( logWarn ) . toHaveBeenCalledWith (
99+ 'bundle-mcp: server "probe": env "ANSIBLE_CONFIG" is blocked for stdio startup safety and was ignored.' ,
100+ ) ;
101+ expect ( logWarn ) . toHaveBeenCalledWith (
102+ 'bundle-mcp: server "probe": env "TF_CLI_CONFIG_FILE" is blocked for stdio startup safety and was ignored.' ,
103+ ) ;
95104 } ) ;
96105
97106 it ( "uses an explicit empty stdio env when all configured env keys are blocked" , ( ) => {
0 commit comments