steveloughran opened a new issue, #17214:
URL: https://github.com/apache/iceberg/issues/17214

   ### Feature Request / Improvement
   
   
   Harden puffin reader/roaring bitmap parsing.
   
   1. DeleteFile values aren't validated on all codepaths before reading.
   2. Roaring bitmap structs are allocated in memory before the read, trusting 
the declaration in the file.
   
   #2 is the big one; deserialization can be abused to allocate 2^31 bitmap 
structs, which would be disruptive on any multitenant process. 
   
   Claude review of production file reading
   
   | Site | File | Role |
   |---|---|---|
   | Generic footer + blob read | `core/.../puffin/PuffinReader.java` | reads 
footer, seeks/allocates per blob |
   | Zstd decompress | `core/.../puffin/PuffinFormat.java` | header-driven 
output allocation |
   | DV read (query path) | `data/.../data/BaseDeleteLoader.java` `readDV` | 
guarded by `validateDV` |
   | DV read (merge path) | `core/.../DVUtil.java` `readDV` | **not** guarded |
   | DV blob envelope (len/magic/CRC) | 
`core/.../deletes/BitmapPositionDeleteIndex.java` | length prefix, magic, CRC, 
cardinality |
   | Roaring bitmap deserialize | `core/.../deletes/RoaringPositionBitmap.java` 
| count/key-driven allocation |
   | DV rewrite | `core/.../RewriteTablePathUtil.java` `rewriteDVFile` | only 
production caller of `PuffinReader.readAll` |
   
   
   
   ### Query engine
   
   None
   
   ### Willingness to contribute
   
   - [x] I can contribute this improvement/feature independently
   - [ ] I would be willing to contribute this improvement/feature with 
guidance from the Iceberg community
   - [ ] I cannot contribute this improvement/feature at this time


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to