From 9e8b781fc97d8fadfe1b02c86339c5d9d8ec976f Mon Sep 17 00:00:00 2001 From: ClaudioWayne <35531629+ClaudioWayne@users.noreply.github.com> Date: Tue, 29 Sep 2026 06:38:37 +0000 Subject: [PATCH] Fix peepdf 5.0.0 indirect object resolution (#3260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PDF processing logged the following exception when peepdf encountered an indirect reference: `AttributeError: 'PDFReference' object has no attribute 'getElementByName'` CAPE attempted to identify references using the nonexistent `type` and `id` attributes. peepdf 5.0.0 exposes these values through `getType()` and `getId()`. Because the exception was caught, PDF processing continued and most report fields remained unchanged. However, base URI and annotation URL resolution could fail. - Use `getType()` and `getId()` to resolve peepdf reference objects. Changed files - lib/cuckoo/common/integrations/peepdf.py - Lines 40–41 now use obj.getType() and obj.getId() to resolve indirect PDF objects. --- lib/cuckoo/common/integrations/peepdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 lib/cuckoo/common/integrations/peepdf.py diff --git a/lib/cuckoo/common/integrations/peepdf.py b/lib/cuckoo/common/integrations/peepdf.py old mode 100644 new mode 100755 index 3d4d082e23a..560bdc5dcb2 --- a/lib/cuckoo/common/integrations/peepdf.py +++ b/lib/cuckoo/common/integrations/peepdf.py @@ -37,8 +37,8 @@ def _load_peepdf(): def _get_obj_val(pdf, version: int, obj): with contextlib.suppress(Exception): - if obj.type == "reference": - return pdf.body[version].getObject(obj.id) + if obj.getType() == "reference": + return pdf.body[version].getObject(obj.getId()) return obj