apache / apache/poi

SXSSFWorkbook fails to set extended information extra field in Zip64 mode

Open
#1,018 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
844
Avg merge
5h 52m
Merged PRs (30d)
47

Description

Tested with version 5.5.1 , local file header (LOC) generated while using SXSSFWorkbook with zip64 mode is not set as per the spec (6.3.9) given below;

https://pkwaredownloads.blob.core.windows.net/pkware-general/Documentation/APPNOTE-6.3.9.TXT

```
4.3.9.2 When compressing files, compressed and uncompressed sizes
SHOULD be stored in ZIP64 format (as 8 byte values) when a
file's size exceeds 0xFFFFFFFF. **_However ZIP64 format MAY be
used regardless of the size of a file. When extracting, if
the zip64 extended information extra field is present for
the file the compressed and uncompressed sizes will be 8
byte values._**

```
I was expecting zip64 extended information extra field to be present in LOC header when compressed and uncompressed sizes were represented as 8 bytes in the data directory record. As a result the application reading data directory record will endup reading it in zip32 mode, this results in both compressed and uncompressed size to be incorrect.

Image
Fig 1: Local file header

extended information extra field is not set (purple) , CRC (green) , compressed size (orange) , uncompressed size(red)

Image

Fig 2: Data directory record

Reading application has no way to determine if the data directory record is represented in Zip32 or Zip64 mode .

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how SXSSFWorkbook generates the ZIP64 local file header and compare the header fields with PKWARE APPNOTE 6.3.9. Verify that the ZIP64 extended information extra field is present when the directory record stores 8-byte sizes, then add a regression test for the header and confirm the reported sizes can be read correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.