mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-20 04:54:24 +02:00
S3 Tables: validate ARN namespace to prevent path traversal
- Enforce validation on decoded namespace in parseTableFromARN. - Ensures path components are safe after URL unescaping.
This commit is contained in:
1 parent
f13e250fc3
commit
ae19621230
1 file changed
+5
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user