KDE Project Security Advisory ============================= Title: Okular: Arbitrary code execution in javascript engine Risk Rating: High CVE: CVE-2026-124454 Versions: Okular < 26.08.02; likely from 23.08 and later versions Date: 12 November 2026 Overview ======== Okular is a universal document viewer. Okular can open PDF files and execute javascript embedded in the pdf file. Javascript support is compile-time optional, but enabled by default. Opening a special crafted PDF file can lead to arbitrary code execution. Impact ====== Opening a specially crafted pdf file with javascript can trigger a use-after-free due to unclear object ownership and usage between the javascript engine and the surrounding c++ code. These issues that can lead to code execution. The proof-of-concept demonstrated arbitrary code execution using hardcoded pointer-offsets derived from the Okular and underlying libraries but can probably be generalized. Workaround ========== Do not open untrusted pdf files with a vulnerable Okular. Solution ======== Update Okular >= 26.08.2 or apply the following patches: https://commits.kde.org/okular/0efa859b9 (release/26.08) JS: Ensure interval timers dont outlive the app https://commits.kde.org/okular/69afb8e79 JS: Scope interval timer lifetime more narrow https://commits.kde.org/okular/c16ca685c JS: move interval timers to document scope https://commits.kde.org/okular/28eec549c JS: move field cache to document scope https://commits.kde.org/okular/80991d375 JS: Make all bridge-object cppowned https://commits.kde.org/okular/7a336ee09 JS: Ensure global objects are c++ owned https://commits.kde.org/okular/c76411016 JS: Ensure timers dont outlive the app https://commits.kde.org/okular/0eff99e7f * Wrap some pdf specific javascript console functions to console.log https://commits.kde.org/okular/469590036 * Drop custom non-functioning console logger; just debug dump things https://commits.kde.org/okular/601e76fcc Memory-safety: Dont let raw pointers out https://commits.kde.org/okular/97d932197 Small executeScriptEvent refactor https://commits.kde.org/okular/958ccfe7a Check action is of type Script before static casting to it https://commits.kde.org/okular/56a85cbb3 * fix: resolve ScriptAction memory leak in openDocument Commits marked with * are not strictly neccesary, but simplifies patch porting. The original debug console code might need changes if these aren't included. Credits ======= Thanks to David Chen (raggedsec) for reporting the issue Thanks to Sune Stolborg Vuorela and g10 Code for investigating and fixing the issue