Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

S3 Tables: validate ARN namespace to prevent path traversal

Chris Luae19621230f5
diff --git a/weed/s3api/s3tables/utils.go b/weed/s3api/s3tables/utils.go
index 12b180c6d2..ccbe31feef 100644
--- a/weed/s3api/s3tables/utils.go
+++ b/weed/s3api/s3tables/utils.go
@@ -43,6 +43,11 @@ func parseTableFromARN(arn string) (bucketName, namespace, tableName string, err
return "", "", "", fmt.Errorf("invalid namespace encoding in ARN: %v", err)
}
+ _, err = validateNamespace([]string{namespaceUnescaped})
+ if err != nil {
+ return "", "", "", fmt.Errorf("invalid namespace in ARN: %v", err)
+ }
+
return matches[1], namespaceUnescaped, matches[3], nil
}