Skip to content

Commit 2b30571

Browse files
committed
Sanitize Patterns, Licenses 2025-07-29
Signed-off-by: Julio Jimenez <julio@clickhouse.com>
1 parent 42961e3 commit 2b30571

3 files changed

Lines changed: 1 addition & 14 deletions

File tree

lib/sanitize.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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")

license-mappings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
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",

test/simple.bats

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,3 @@ EOF
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-
}

0 commit comments

Comments
 (0)