[ 
https://issues.apache.org/jira/browse/PDFBOX-6388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maruan Sahyoun updated PDFBOX-6388:
-----------------------------------
    Affects Version/s: 3.0.8 PDFBox
                       2.0.37
                       4.0.0

> Read object streams only once
> -----------------------------
>
>                 Key: PDFBOX-6388
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-6388
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.37, 3.0.8 PDFBox, 4.0.0
>            Reporter: Maruan Sahyoun
>            Assignee: Maruan Sahyoun
>            Priority: Minor
>
> When an object is marked as compressed in an object stream, `COSParser` 
> decompresses and parses the object stream and caches the objects it contains. 
> If the requested object isn't part of the object stream, the whole stream is 
> decompressed and parsed again for every such object. A cross reference stream 
> may mark a huge number of objects as part of an object stream which doesn't 
> contain them, so a small file can make PDFBox decompress the same stream 
> millions of times when the document is processed.
> Proposed change
>  - Read each object stream only once, an object which isn't found in an 
> already read object stream isn't part of it
>  - Add a test with an xref stream referring to many objects missing in the 
> object stream
> Found by a Claude security scan.
> Claude on behalf of Maruan Sahyoun (msahyoun)



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to