Underscores is a valid symbol in the bucket name, the doc
Bucket names can only contain lowercase letters, numeric characters, dashes (-), underscores (_), and dots (.). Spaces are not allowed. Names containing dots require verification.
The current approach uses java.net.URI, which is not allowing to have underscores in the host name of URI. It leads to wrongly requested access boundaries, because the bucket name is being set as null.
To Reproduce
| Welcome to JShell -- Version 11.0.22
| For an introduction type: /help intro
jshell> String location = "gs://test_bucket/iceberg/data"
location ==> "gs://test_bucket/iceberg/data"
jshell> URI uri = uri.create(location);
uri ==> gs://test_bucket/iceberg/data
jshell> uri.getHost()
$3 ==> null
Actual Behavior
The bucket name is set as null
Expected Behavior
The bucket name is set as test_bucket
Additional context
I guess this class from com.google.cloud.storage can be used instead
Is this a possible security vulnerability?
Describe the bug
Underscores is a valid symbol in the bucket name, the doc
The current approach uses
java.net.URI
, which is not allowing to have underscores in the host name of URI. It leads to wrongly requested access boundaries, because the bucket name is being set asnull
.To Reproduce
Actual Behavior
The bucket name is set as
null
Expected Behavior
The bucket name is set as
test_bucket
Additional context
I guess this class from
com.google.cloud.storage
can be used insteadSystem information
Object storage: GCS