Hash Variant object keys in ExpressionUtil.sanitize (not only values)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in org.apache.iceberg.expressions.ExpressionUtil at sanitizeVariantObject and inspect how object keys are formatted versus values. Update the Variant sanitization test in org.apache.iceberg.expressions.TestExpressionUtil, then run that unit test. Done means sensitive Variant object keys are sanitized like string values while schema column names remain visible.
Written by the indexing model from the issue text.
Description
After review, this is not considered a serious vulnerability that needs to be kept private. Sanitized expressions are an operator metrics/log surface, but Variant object keys are query literals and should be hashed like other strings. Filed publicly as a sanitizer bug.
Summary
ExpressionUtil.sanitize is meant to redact predicate constants (hashed strings, digit-count for numbers, coarse dates). For Variant objects it formats keys as (hash-%s) with the original field name, then sanitizes the value. TestExpressionUtil currently expects that: keys look like (hash-event_name) while values look like (hash-79b17dd6).
Variant object keys are user data (they can hold the same secrets people put in string literals). Iceberg schema column names in the expression stay visible on purpose; these keys should not.
Consumers of the sanitized string include SnapshotScan ScanReport.filter (REST catalog metrics when v1/report-metrics is on) and any other ExpressionUtil.sanitize caller.
Fix: run object keys through sanitizeSimpleString (same as string values) and update the unit test.
Affected Maven coordinates
org.apache.iceberg:iceberg-api
Attacker prerequisites
- a query (or bound expression) whose Variant literal uses sensitive strings as object keys
- read access to sanitized scan filters (metrics reporter / logs), not table data
Impact
- Predicate constants that people believed were hashed can appear in ScanReport / logs as Variant keys
- Does not grant table access; it is a sanitizer miss on an operator surface
Proof status
Source review. Visible in sanitizeVariantObject and the existing unit test expectations.
Key source references
org.apache.iceberg.expressions.ExpressionUtil(sanitizeVariantObject, format(hash-%s)withfield)org.apache.iceberg.expressions.TestExpressionUtil(Variant sanitize test)org.apache.iceberg.SnapshotScan(ExpressionUtil.sanitizeintoScanReport)
Related
- apache/iceberg#11479 / PR #13137 added recursive Variant sanitizing. That ticket’s example kept object keys in the clear (
hash-id) and hashed/coarsened values. This issue is a follow-up: keys are query data (like map-key literals onmp.key), not schema identifiers, and should go throughsanitizeSimpleString. No open issue covers hashing the keys.
- Dominant language
- Java
- Stars
- 9.3k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 143
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
improvement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100