File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,12 +196,6 @@ sanitize_patterns() {
196196 # Remove dangerous characters but keep wildcards
197197 local sanitized_pattern
198198 sanitized_pattern=$( echo " $pattern " | sed ' s/[^a-zA-Z0-9.*_-]//g' )
199-
200- # Prevent directory traversal patterns
201- if [[ " $sanitized_pattern " =~ (\.\. /| ^\. /) ]]; then
202- log_error " Invalid pattern: $pattern contains directory traversal sequences"
203- exit 1
204- fi
205199
206200 if [[ -n " $sanitized_pattern " ]]; then
207201 sanitized_patterns+=(" $sanitized_pattern " )
Original file line number Diff line number Diff line change 189189 "github.com/bytedance/sonic" : " Apache-2.0" ,
190190 "github.com/bytedance/sonic/loader" : " Apache-2.0" ,
191191 "github.com/c-bata/go-prompt" : " MIT" ,
192+ "github.com/cactus/go-statsd-client/statsd" : " MIT" ,
192193 "github.com/Azure/azure-amqp-common-go/v3" : " MIT" ,
193194 "github.com/Azure/azure-pipeline-go" : " MIT" ,
194195 "github.com/Azure/azure-sdk-for-go-extensions" : " MIT" ,
Original file line number Diff line number Diff line change 756756 [ " $status " -eq 0 ]
757757 [[ " $output " == " *.json" ]]
758758}
759-
760- # Test 86: sanitize_patterns rejects patterns with directory traversal
761- @test " sanitize_patterns rejects patterns with directory traversal" {
762- run sanitize_patterns " ../test.json,./test.txt"
763- echo " $output "
764- [ " $status " -eq 1 ]
765- [[ " $output " =~ Invalid\ pattern\:\ \.\.\/ test\. json\ contains\ directory\ traversal\ sequences ]]
766- }
You can’t perform that action at this time.
0 commit comments