Hi -

Take a look at this wikipedia for one example. 
https://en.wikipedia.org/wiki/Billion_laughs_attack 
<https://en.wikipedia.org/wiki/Billion_laughs_attack>

Without knowing what your file is supposed to be and without slicing and dicing 
it, it is hard to know.

Where did your file come from? The wild? If so then it may be worth discussing 
the file itself in private because it may be a security issue.

For further research I would unzip the file in your OS and then examine the 
header for each of the files contained in the zip. Note how much larger the 
unzipped files become.

Regards,
Dave

> On Mar 25, 2019, at 7:26 AM, Scott Gardner <[email protected]> wrote:
> 
> I understand that, but specifically what is it in a .zip file that will cause 
> this if statement to throw the IllegalStateException?  I don't understand 
> where the values of text.length() and string.length() are coming from.
>       int size = text.length() + string.length();
>       if(size > ZipSecureFile.getMaxTextSize()) {
> I'm getting this exception and I don't know what (in the .zip file) is 
> causing this to be thrown.
> The text would exceed the max allowed overall size of extracted text. By 
> default this is prevented as some documents may exhaust available memory and 
> it may indicate that the file is used to inflate memory usage and thus could 
> pose a security risk. You can adjust this limit via 
> ZipSecureFile.setMaxTextSize() if you need to work with files which have a 
> lot of text. Size: 10485785, limit: MAX_TEXT_SIZE: 10485760
> 
> On 2019/03/22 18:39:06, Scott Gardner <[email protected]> wrote:
>> Can someone explain what causes IllegalStateException to be thrown in>
>> POIXMLTextExtractor.java?>
>> 
>> In the file  org/apache/poi/POIXMLTextExtractor.java is this if statement>
>> 
>>   if(size > ZipSecureFile.getMaxTextSize()) {>
>>      throw new IllegalStateException("The text would exceed the max>
>> allowed overall size of extracted text. ">
>>        + "By default this is prevented as some documents may exhaust>
>> available memory and it may indicate that the file is used to inflate>
>> memory usage and thus could pose a security risk. ">
>>        + "You can adjust this limit via ZipSecureFile.setMaxTextSize() if>
>> you need to work with files which have a lot of text. ">
>>        + "Size: " + size + ", limit: MAX_TEXT_SIZE: " +>
>> ZipSecureFile.getMaxTextSize());>
>>   }>
>> 
>> Can someone tell me exactly what causes this message to be printed? What>
>> does "The text" mean in the context of that message?>
>> Can someone give me a .zip file that will cause this message to appear and>
>> explain to me what it is about the contents of the .zip file>
>> causes that message to be printed?>
>> 

Reply via email to