apache / polaris

The interoperable, open source catalog for Apache Iceberg
http://polaris.io/
Apache License 2.0
1.01k stars 96 forks source link

[BUG] Incorrect usage of the X-Iceberg-Access-Delegation header #146

Open dimas-b opened 1 month ago

dimas-b commented 1 month ago

Is this a possible security vulnerability?

Describe the bug

Iceberg REST spec defines the following two values for the X-Iceberg-Access-Delegation HTTP header:

However, current Polaris examples / docs use the value of true, which does not match anything in the Iceberg REST spec.

Current code appears to treat any non-empty header as vended-credentials, which is not exactly correct.

To Reproduce

No response

Actual Behavior

No response

Expected Behavior

Additional context

No response

System information

No response

dennishuo commented 3 weeks ago

This was definitely an unfortunate oversight; good catch!

Luckily, since the bug wasn't that the request handlers actually expected to parse true from the String, just that they only checked !isNullOrEmpty to assume it meant vended-credentials, it's forward-compatible if anyone is using the "correct" syntax.

We should try to update docs as quickly as possible to reduce the degree to which X-Iceberg-Access-Delegation: true gets entrenched into various workflows or test scripts of anyone integrating with Polaris.

At this point it may already be prudent to have an option for still falling back to the vended-credentials behavior if none of the comma-separated list of supported mechanisms is recognized (including the string "true").