[
https://issues.apache.org/jira/browse/PDFBOX-6388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18155726#comment-18155726
]
ASF subversion and git services commented on PDFBOX-6388:
---------------------------------------------------------
Commit 1941411 from Maruan Sahyoun in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1941411 ]
PDFBOX-6388: Read object streams only once
Co-Authored-By: Claude <[email protected]>
> 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
> Fix For: 2.0.38, 3.0.9 PDFBox, 4.0.0
>
>
> 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]