From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Thu, 6 Nov 2025 09:36:53 +0530
Subject: Fix CVE-2025-64486

Bug: https://github.com/kovidgoyal/calibre/security/advisories/GHSA-hpwq-c98h-xp8g
Origin: https://github.com/kovidgoyal/calibre/commit/6f94bce214bf7d43c829804db3741afa5e83c0c5
---
 src/calibre/ebooks/conversion/plugins/fb2_input.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/calibre/ebooks/conversion/plugins/fb2_input.py b/src/calibre/ebooks/conversion/plugins/fb2_input.py
index dae3137..a71011b 100644
--- a/src/calibre/ebooks/conversion/plugins/fb2_input.py
+++ b/src/calibre/ebooks/conversion/plugins/fb2_input.py
@@ -161,7 +161,7 @@ class FB2Input(InputFormatPlugin):
         from calibre.ebooks.fb2 import base64_decode
         self.binary_map = {}
         for elem in doc.xpath('./*'):
-            if elem.text and 'binary' in elem.tag and 'id' in elem.attrib:
+            if elem.text and 'binary' in elem.tag and elem.get('id', ''):
                 ct = elem.get('content-type', '')
                 fname = elem.attrib['id']
                 ext = ct.rpartition('/')[-1].lower()
