Hi,

I've prepared okular 4:22.12.3-1+deb12u2 for bookworm-security. Attached
is the debdiff ready for review, and attached is a draft DLA
announcement.

I have also backported the patch to trixie and sent to the security team. I
will reserve the DLA and upload once they issue a DSA if there are no issues.

[ Changes ]

  * Backport fix for CVE-2026-124454
    This patch fixes a use-after-free caused by unclear object ownership,
    which can lead to arbitrary code execution from opening a specially
    crafted PDF file.

[ Details ]

Backporting this patch was non-trivial compared to the trixie backport.

This patch fixes a use-after-free caused by unclear object ownership, which can
lead to arbitrary code execution from opening a specially crafted PDF file.

This patch backports the commits required to fix CVE-2026-124454 (arbitrary
code execution in Javascript engine) as per the commits listed in
https://kde.org/info/security/advisory-20261112-1.txt (bottom to top).
The commits labelled "not essential" have not been included.

The changes are:
- Check action is of type Script before static casting to it.
- Change executeScriptEvent (core/document.cpp) to accept a reference (&)
  rather than a pointer (*) to make it clear null is not a valid value.
- Change event from pointer (Event*) to a shared pointer (const
  std::shared_ptr<Event>).
- Prevent timers from outliving the current JS application: switch QTimer's
        parent to the Document in JSApp::setTimeOut and JSApp::setInterval.
- Move field cache to document scope to ensure that one document getting closed
  doesn't destroy cache from other documents.
- Move interval timers to document scope to ensure that closing a document
  doesn't invalidate intervals from other documents.

Differences between upstream and this patch:
- This version of okular uses the older KJS library, which does not have the JS
        vs C++ ownership issues. Therefore, upstream's 7a336ee09 and 80991d375 
do not
        apply.
- There is no m_events queue in this version of okular.
- The KJS* classes are not stateful in this version of okular compared to
        upstream, in that they have no members and all methods are static. As a
        result, the code must traverse all the way to ExecutorKJS to access the
        fieldCache and timerCache (e.g. this can be seen in cacheForPage 
function
        defined in core/script/kjs_field.cpp). Null checks are likely 
unnecessary but
        they have been added just in case to prevent any regression here.
- Lack of statefulness is the motivation behind a new JSTimerCache class which
        is stored as a member in ExecutorKJS.
- QTimer cannot be bound to "this" in JSApp, since JSApp is not stateful.
        Hence, it is bound to doc->m_parent (Document), and is cleaned up in
        JSTimerCache's destructor as well. (This also means 69afb8e79 does not 
apply
        at all.)

[ Build ]

Debusine: https://debusine.debian.net/debian/developers/work-request/1684217/

Salsa fork: 
https://salsa.debian.org/Maytha8/okular/-/tree/debian/bookworm/debian?ref_type=heads

--
Maytham
diff -Nru okular-22.12.3/debian/changelog okular-22.12.3/debian/changelog
--- okular-22.12.3/debian/changelog	2026-06-08 20:13:04.000000000 +0800
+++ okular-22.12.3/debian/changelog	2026-11-29 23:44:53.000000000 +0800
@@ -1,3 +1,13 @@
+okular (4:22.12.3-1+deb12u2) bookworm-security; urgency=high
+
+  * Non-maintainer upload by the LTS Team.
+  * Backport fix for CVE-2026-124454
+    This patch fixes a use-after-free caused by unclear object ownership,
+    which can lead to arbitrary code execution from opening a specially
+    crafted PDF file.
+
+ -- Maytham Alsudany <[email protected]>  Sun, 29 Nov 2026 23:44:53 +0800
+
 okular (4:22.12.3-1+deb12u1) bookworm-security; urgency=medium
 
   * Multiple security issues in parsing Fax files
diff -Nru okular-22.12.3/debian/patches/CVE-2026-124454.patch okular-22.12.3/debian/patches/CVE-2026-124454.patch
--- okular-22.12.3/debian/patches/CVE-2026-124454.patch	1970-01-01 08:00:00.000000000 +0800
+++ okular-22.12.3/debian/patches/CVE-2026-124454.patch	2026-11-29 23:44:53.000000000 +0800
@@ -0,0 +1,591 @@
+From: Sune Vuorela <[email protected]>
+From: Albert Astals Cid <[email protected]>
+From: Maytham Alsudany <[email protected]>
+Subject: Backport fix for CVE-2026-124454
+
+This patch fixes a use-after-free caused by unclear object ownership, which can
+lead to arbitrary code execution from opening a specially crafted PDF file.
+
+This patch backports the commits required to fix CVE-2026-124454 (arbitrary
+code execution in Javascript engine) as per the commits listed in
+https://kde.org/info/security/advisory-20261112-1.txt (bottom to top).
+The commits labelled "not essential" have not been included.
+
+The changes are:
+- Check action is of type Script before static casting to it.
+- Change executeScriptEvent (core/document.cpp) to accept a reference (&)
+  rather than a pointer (*) to make it clear null is not a valid value.
+- Change event from pointer (Event*) to a shared pointer (const
+  std::shared_ptr<Event>).
+- Prevent timers from outliving the current JS application: switch QTimer's
+	parent to the Document in JSApp::setTimeOut and JSApp::setInterval.
+- Move field cache to document scope to ensure that one document getting closed
+  doesn't destroy cache from other documents.
+- Move interval timers to document scope to ensure that closing a document
+  doesn't invalidate intervals from other documents.
+
+Differences between upstream and this patch:
+- This version of okular uses the older KJS library, which does not have the JS
+	vs C++ ownership issues. Therefore, upstream's 7a336ee09 and 80991d375 do not
+	apply.
+- There is no m_events queue in this version of okular.
+- The KJS* classes are not stateful in this version of okular compared to
+	upstream, in that they have no members and all methods are static. As a
+	result, the code must traverse all the way to ExecutorKJS to access the
+	fieldCache and timerCache (e.g. this can be seen in cacheForPage function
+	defined in core/script/kjs_field.cpp). Null checks are likely unnecessary but
+	they have been added just in case to prevent any regression here.
+- Lack of statefulness is the motivation behind a new JSTimerCache class which
+	is stored as a member in ExecutorKJS.
+- QTimer cannot be bound to "this" in JSApp, since JSApp is not stateful.
+	Hence, it is bound to doc->m_parent (Document), and is cleaned up in
+	JSTimerCache's destructor as well. (This also means 69afb8e79 does not apply
+	at all.)
+
+--- a/core/script/kjs_field_p.h
++++ b/core/script/kjs_field_p.h
+@@ -8,6 +8,10 @@
+ #ifndef OKULAR_SCRIPT_KJS_FIELD_P_H
+ #define OKULAR_SCRIPT_KJS_FIELD_P_H
+ 
++#include <QHash>
++#include <QString>
++#include <memory>
++
+ class KJSContext;
+ class KJSObject;
+ 
+@@ -16,12 +20,35 @@
+ class FormField;
+ class Page;
+ 
++class JSFieldCache
++{
++public:
++    void insertForm(FormField *field, Page *page)
++    {
++        formCache.insert(field, page);
++    }
++    Page *pageForField(FormField *field)
++    {
++        return formCache.value(field, nullptr);
++    }
++    void insertButton(const QString &id, FormField *button)
++    {
++        buttonCache.insert(id, button);
++    }
++    FormField *buttonForName(const QString &id)
++    {
++        return buttonCache.value(id, nullptr);
++    }
++private:
++    QHash<FormField *, Page *> formCache;
++    QHash<QString, FormField *> buttonCache;
++};
++
+ class JSField
+ {
+ public:
+     static void initType(KJSContext *ctx);
+     static KJSObject wrapField(KJSContext *ctx, FormField *field, Page *page);
+-    static void clearCachedFields();
+ };
+ 
+ }
+--- a/core/script/kjs_field.cpp
++++ b/core/script/kjs_field.cpp
+@@ -15,12 +15,14 @@
+ 
+ #include <QDebug>
+ #include <QTimer>
++#include <memory>
+ 
+ #include "../debug_p.h"
+ #include "../document_p.h"
+ #include "../form.h"
+ #include "../page.h"
+ #include "../page_p.h"
++#include "../scripter.h"
+ #include "kjs_display_p.h"
+ 
+ using namespace Okular;
+@@ -29,15 +31,19 @@
+ 
+ static KJSPrototype *g_fieldProto;
+ 
+-typedef QHash<FormField *, Page *> FormCache;
+-Q_GLOBAL_STATIC(FormCache, g_fieldCache)
+-typedef QHash<QString, FormField *> ButtonCache;
+-Q_GLOBAL_STATIC(ButtonCache, g_buttonCache)
++static std::shared_ptr<JSFieldCache> cacheForPage(Page *page)
++{
++    if (!page) {
++        return nullptr;
++    }
++    DocumentPrivate *doc = PagePrivate::get(page)->m_doc;
++    return doc && doc->m_scripter && doc->m_scripter->getExecutor() ? doc->m_scripter->getExecutor()->getFieldCache() : nullptr;
++}
+ 
+ // Helper for modified fields
+ static void updateField(FormField *field)
+ {
+-    Page *page = g_fieldCache->value(field);
++    Page *page = field->page();
+     if (page) {
+         Document *doc = PagePrivate::get(page)->m_doc->m_parent;
+         const int pageNumber = page->number();
+@@ -251,7 +257,9 @@
+ 
+     KJSObject fieldObject;
+     fieldObject.setProperty(ctx, OKULAR_NAME, field->fullyQualifiedName());
+-    g_buttonCache->insert(field->fullyQualifiedName(), field);
++    if (auto m_fieldCache = cacheForPage(field->page())) {
++        m_fieldCache->insertButton(field->fullyQualifiedName(), field);
++    }
+ 
+     return fieldObject;
+ }
+@@ -267,7 +275,9 @@
+ 
+     if (field->type() == Okular::FormField::FormButton) {
+         FormFieldButton *button = static_cast<FormFieldButton *>(field);
+-        button->setIcon(g_buttonCache->value(fieldName));
++        if (auto m_fieldCache = cacheForPage(field->page())) {
++            button->setIcon(m_fieldCache->buttonForName(fieldName));
++        }
+     }
+ 
+     updateField(field);
+@@ -304,17 +314,8 @@
+     // ### cache unique wrapper
+     KJSObject f = g_fieldProto->constructObject(ctx, field);
+     f.setProperty(ctx, QStringLiteral("page"), page->number());
+-    g_fieldCache->insert(field, page);
+-    return f;
+-}
+-
+-void JSField::clearCachedFields()
+-{
+-    if (g_fieldCache.exists()) {
+-        g_fieldCache->clear();
+-    }
+-
+-    if (g_buttonCache.exists()) {
+-        g_buttonCache->clear();
++    if (auto m_fieldCache = cacheForPage(page)) {
++        m_fieldCache->insertForm(field, page);
+     }
++    return f;
+ }
+--- a/core/scripter.cpp
++++ b/core/scripter.cpp
+@@ -8,6 +8,7 @@
+ 
+ #include <QDebug>
+ #include <QFile>
++#include <memory>
+ 
+ #include "debug_p.h"
+ #include "script/executor_kjs_p.h"
+@@ -30,7 +31,7 @@
+ #ifdef WITH_KJS
+     QScopedPointer<ExecutorKJS> m_kjs;
+ #endif
+-    Event *m_event;
++    std::shared_ptr<Event> m_event;
+ };
+ 
+ Scripter::Scripter(DocumentPrivate *doc)
+@@ -68,12 +69,17 @@
+ #endif
+ }
+ 
+-void Scripter::setEvent(Event *event)
++void Scripter::setEvent(const std::shared_ptr<Event> &event)
+ {
+     d->m_event = event;
+ }
+ 
+-Event *Scripter::event() const
++std::shared_ptr<Event> Scripter::event() const
+ {
+     return d->m_event;
+ }
++
++ExecutorKJS *Scripter::getExecutor() const
++{
++    return d->m_kjs.get();
++}
+--- a/core/scripter.h
++++ b/core/scripter.h
+@@ -8,6 +8,7 @@
+ #define OKULAR_SCRIPTER_H
+ 
+ #include "global.h"
++#include "script/executor_kjs_p.h"
+ 
+ class QString;
+ 
+@@ -31,8 +32,10 @@
+ 
+     void execute(ScriptType type, const QString &script);
+ 
+-    void setEvent(Event *event);
+-    Event *event() const;
++    void setEvent(const std::shared_ptr<Event> &event);
++    std::shared_ptr<Event> event() const;
++
++    ExecutorKJS *getExecutor() const;
+ 
+ private:
+     friend class ScripterPrivate;
+--- a/core/script/executor_kjs.cpp
++++ b/core/script/executor_kjs.cpp
+@@ -50,6 +50,8 @@
+     void initTypes();
+ 
+     DocumentPrivate *m_doc;
++    std::shared_ptr<JSFieldCache> m_fieldCache = std::make_shared<JSFieldCache>();
++    std::shared_ptr<JSTimerCache> m_timerCache = std::make_shared<JSTimerCache>();
+     KJSInterpreter *m_interpreter;
+     KJSGlobalObject m_docObject;
+ };
+@@ -92,13 +94,11 @@
+ 
+ ExecutorKJS::~ExecutorKJS()
+ {
+-    JSField::clearCachedFields();
+-    JSApp::clearCachedFields();
+     JSOCG::clearCachedFields();
+     delete d;
+ }
+ 
+-void ExecutorKJS::execute(const QString &script, Event *event)
++void ExecutorKJS::execute(const QString &script, const std::shared_ptr<Event> &event)
+ {
+     KJSContext *ctx = d->m_interpreter->globalContext();
+ 
+@@ -122,3 +122,10 @@
+         }
+     }
+ }
++
++const std::shared_ptr<JSFieldCache> &ExecutorKJS::getFieldCache() const {
++    return d->m_fieldCache;
++}
++const std::shared_ptr<JSTimerCache> &ExecutorKJS::getTimerCache() const {
++    return d->m_timerCache;
++}
+--- a/core/script/executor_kjs_p.h
++++ b/core/script/executor_kjs_p.h
+@@ -7,6 +7,9 @@
+ #ifndef OKULAR_SCRIPT_EXECUTOR_KJS_P_H
+ #define OKULAR_SCRIPT_EXECUTOR_KJS_P_H
+ 
++#include "kjs_app_p.h"
++#include "kjs_field_p.h"
++#include <memory>
+ class QString;
+ 
+ namespace Okular
+@@ -24,7 +27,10 @@
+     ExecutorKJS(const ExecutorKJS &) = delete;
+     ExecutorKJS &operator=(const ExecutorKJS &) = delete;
+ 
+-    void execute(const QString &script, Event *event);
++    void execute(const QString &script, const std::shared_ptr<Event> &event);
++
++    const std::shared_ptr<JSFieldCache> &getFieldCache() const;
++    const std::shared_ptr<JSTimerCache> &getTimerCache() const;
+ 
+ private:
+     friend class ExecutorKJSPrivate;
+--- a/core/document.cpp
++++ b/core/document.cpp
+@@ -1181,7 +1181,7 @@
+                 for (FormField *form : forms) {
+                     if (form->id() == formId) {
+                         Action *action = form->additionalAction(FormField::CalculateField);
+-                        if (action) {
++                        if (action && action->actionType() == Action::Script) {
+                             FormFieldText *fft = dynamic_cast<FormFieldText *>(form);
+                             std::shared_ptr<Event> event;
+                             QString oldVal;
+@@ -1191,7 +1191,7 @@
+                                 if (!m_scripter) {
+                                     m_scripter = new Scripter(this);
+                                 }
+-                                m_scripter->setEvent(event.get());
++                                m_scripter->setEvent(event);
+                                 // The value maybe changed in javascript so save it first.
+                                 oldVal = fft->text();
+                             }
+@@ -2216,13 +2216,18 @@
+     return foundPage;
+ }
+ 
+-void DocumentPrivate::executeScriptEvent(const std::shared_ptr<Event> &event, const Okular::ScriptAction *linkscript)
++void DocumentPrivate::executeScriptEvent(const std::shared_ptr<Event> &event, const Okular::ScriptAction &linkscript)
++{
++    executeScriptEvent(event, linkscript.scriptType(), linkscript.script());
++}
++
++void DocumentPrivate::executeScriptEvent(const std::shared_ptr<Event> &event, ScriptType type, const QString &script)
+ {
+     if (!m_scripter) {
+         m_scripter = new Scripter(this);
+     }
+-    m_scripter->setEvent(event.get());
+-    m_scripter->execute(linkscript->scriptType(), linkscript->script());
++    m_scripter->setEvent(event);
++    m_scripter->execute(type, script);
+ 
+     // Clear out the event after execution
+     m_scripter->setEvent(nullptr);
+@@ -4320,7 +4325,7 @@
+ 
+     const ScriptAction *linkscript = static_cast<const ScriptAction *>(action);
+ 
+-    d->executeScriptEvent(event, linkscript);
++    d->executeScriptEvent(event, *linkscript);
+ 
+     const QString formattedText = event->value().toString();
+     if (formattedText != unformattedText) {
+@@ -4385,7 +4390,7 @@
+ 
+     const ScriptAction *linkscript = static_cast<const ScriptAction *>(action);
+ 
+-    d->executeScriptEvent(event, linkscript);
++    d->executeScriptEvent(event, *linkscript);
+ 
+     if (event->returnCode()) {
+         fft->setText(newValue.toString());
+@@ -4413,7 +4418,7 @@
+ 
+     const ScriptAction *linkscript = static_cast<const ScriptAction *>(action);
+ 
+-    d->executeScriptEvent(event, linkscript);
++    d->executeScriptEvent(event, *linkscript);
+ 
+     if (event->returnCode()) {
+         fft->setText(event->value().toString());
+@@ -4441,7 +4446,7 @@
+ 
+     const ScriptAction *linkscript = static_cast<const ScriptAction *>(action);
+ 
+-    d->executeScriptEvent(event, linkscript);
++    d->executeScriptEvent(event, *linkscript);
+ }
+ 
+ void Document::processValidateAction(const Action *action, Okular::FormFieldText *fft, bool &returnCode)
+@@ -4462,7 +4467,7 @@
+ 
+     const ScriptAction *linkscript = static_cast<const ScriptAction *>(action);
+ 
+-    d->executeScriptEvent(event, linkscript);
++    d->executeScriptEvent(event, *linkscript);
+     returnCode = event->returnCode();
+ }
+ 
+--- a/core/document_p.h
++++ b/core/document_p.h
+@@ -235,7 +235,8 @@
+     /*
+      * Executes a ScriptAction with the event passed as parameter.
+      */
+-    void executeScriptEvent(const std::shared_ptr<Event> &event, const Okular::ScriptAction *linkscript);
++    void executeScriptEvent(const std::shared_ptr<Event> &event, const Okular::ScriptAction &linkscript);
++    void executeScriptEvent(const std::shared_ptr<Event> &event, ScriptType type, const QString &script);
+ 
+     /*
+      * Find the corresponding page number for the form field passed as parameter.
+--- a/core/script/kjs_event.cpp
++++ b/core/script/kjs_event.cpp
+@@ -154,7 +154,7 @@
+     g_eventProto->defineProperty(ctx, QStringLiteral("change"), eventGetChange);
+ }
+ 
+-KJSObject JSEvent::wrapEvent(KJSContext *ctx, Event *event)
++KJSObject JSEvent::wrapEvent(KJSContext *ctx, const std::shared_ptr<Event> &event)
+ {
+-    return g_eventProto->constructObject(ctx, event);
++    return g_eventProto->constructObject(ctx, event.get());
+ }
+--- a/core/script/kjs_event_p.h
++++ b/core/script/kjs_event_p.h
+@@ -7,6 +7,8 @@
+ #ifndef OKULAR_SCRIPT_KJS_EVENT_P_H
+ #define OKULAR_SCRIPT_KJS_EVENT_P_H
+ 
++#include <memory>
++
+ class KJSContext;
+ class KJSObject;
+ 
+@@ -18,7 +20,7 @@
+ {
+ public:
+     static void initType(KJSContext *ctx);
+-    static KJSObject wrapEvent(KJSContext *ctx, Event *event);
++    static KJSObject wrapEvent(KJSContext *ctx, const std::shared_ptr<Event> &event);
+     static void clearCachedFields();
+ };
+ 
+--- a/core/script/kjs_app.cpp
++++ b/core/script/kjs_app.cpp
+@@ -32,8 +32,6 @@
+ #define OKULAR_TIMERID QStringLiteral("okular_timerID")
+ 
+ static KJSPrototype *g_appProto;
+-typedef QHash<int, QTimer *> TimerCache;
+-Q_GLOBAL_STATIC(TimerCache, g_timerCache)
+ 
+ // the acrobat version we fake
+ static const double fake_acroversion = 8.00;
+@@ -326,24 +324,29 @@
+     const QString function = arguments.at(0).toString(ctx) + QLatin1Char(';');
+     const int interval = arguments.at(1).toInt32(ctx);
+ 
+-    QTimer *timer = new QTimer();
++    auto timerCache = doc && doc->m_scripter && doc->m_scripter->getExecutor() ? doc->m_scripter->getExecutor()->getTimerCache() : nullptr;
++
++    QTimer *timer = new QTimer(doc->m_parent);
+ 
+     QObject::connect(timer, &QTimer::timeout, doc->m_parent, [=]() { doc->executeScript(function); });
+ 
+     timer->start(interval);
+ 
+-    return JSApp::wrapTimer(ctx, timer);
++    return JSApp::wrapTimer(ctx, timer, timerCache);
+ }
+ 
+ // app.clearInterval()
+-static KJSObject appClearInterval(KJSContext *ctx, void *, const KJSArguments &arguments)
++static KJSObject appClearInterval(KJSContext *ctx, void *object, const KJSArguments &arguments)
+ {
++    DocumentPrivate *doc = reinterpret_cast<DocumentPrivate *>(object);
++    auto timerCache = doc && doc->m_scripter && doc->m_scripter->getExecutor() ? doc->m_scripter->getExecutor()->getTimerCache() : nullptr;
++
+     KJSObject timerObject = arguments.at(0);
+     const int timerId = timerObject.property(ctx, OKULAR_TIMERID).toInt32(ctx);
+-    QTimer *timer = g_timerCache->value(timerId);
++    QTimer *timer = timerCache->value(timerId);
+     if (timer != nullptr) {
+         timer->stop();
+-        g_timerCache->remove(timerId);
++        timerCache->remove(timerId);
+         delete timer;
+     }
+ 
+@@ -357,26 +360,31 @@
+     const QString function = arguments.at(0).toString(ctx) + QLatin1Char(';');
+     const int interval = arguments.at(1).toInt32(ctx);
+ 
+-    QTimer *timer = new QTimer();
++    auto timerCache = doc && doc->m_scripter && doc->m_scripter->getExecutor() ? doc->m_scripter->getExecutor()->getTimerCache() : nullptr;
++
++    QTimer *timer = new QTimer(doc->m_parent);
+     timer->setSingleShot(true);
+ 
+     QObject::connect(timer, &QTimer::timeout, doc->m_parent, [=]() { doc->executeScript(function); });
+ 
+     timer->start(interval);
+ 
+-    return JSApp::wrapTimer(ctx, timer);
++    return JSApp::wrapTimer(ctx, timer, timerCache);
+ }
+ 
+ // app.clearTimeOut()
+-static KJSObject appClearTimeOut(KJSContext *ctx, void *, const KJSArguments &arguments)
++static KJSObject appClearTimeOut(KJSContext *ctx, void *object, const KJSArguments &arguments)
+ {
++    DocumentPrivate *doc = reinterpret_cast<DocumentPrivate *>(object);
++    auto timerCache = doc && doc->m_scripter && doc->m_scripter->getExecutor() ? doc->m_scripter->getExecutor()->getTimerCache() : nullptr;
++
+     KJSObject timerObject = arguments.at(0);
+     const int timerId = timerObject.property(ctx, OKULAR_TIMERID).toInt32(ctx);
+-    QTimer *timer = g_timerCache->value(timerId);
++    QTimer *timer = timerCache->value(timerId);
+ 
+     if (timer != nullptr) {
+         timer->stop();
+-        g_timerCache->remove(timerId);
++        timerCache->remove(timerId);
+         delete timer;
+     }
+ 
+@@ -420,20 +428,20 @@
+     return g_appProto->constructObject(ctx, doc);
+ }
+ 
+-KJSObject JSApp::wrapTimer(KJSContext *ctx, QTimer *timer)
++KJSObject JSApp::wrapTimer(KJSContext *ctx, QTimer *timer, std::shared_ptr<JSTimerCache> &m_timerCache)
+ {
+     KJSObject timerObject = g_appProto->constructObject(ctx, timer);
+     timerObject.setProperty(ctx, OKULAR_TIMERID, timer->timerId());
+ 
+-    g_timerCache->insert(timer->timerId(), timer);
++    if (m_timerCache) {
++        m_timerCache->insert(timer->timerId(), timer);
++    }
+ 
+     return timerObject;
+ }
+ 
+-void JSApp::clearCachedFields()
++JSTimerCache::~JSTimerCache()
+ {
+-    if (g_timerCache) {
+-        qDeleteAll(g_timerCache->begin(), g_timerCache->end());
+-        g_timerCache->clear();
+-    }
++    qDeleteAll(timerCache.begin(), timerCache.end());
++    timerCache.clear();
+ }
+--- a/core/script/kjs_app_p.h
++++ b/core/script/kjs_app_p.h
+@@ -8,6 +8,9 @@
+ #ifndef OKULAR_SCRIPT_KJS_APP_P_H
+ #define OKULAR_SCRIPT_KJS_APP_P_H
+ 
++#include <QHash>
++#include <memory>
++
+ class KJSContext;
+ class KJSObject;
+ class QTimer;
+@@ -16,13 +19,32 @@
+ {
+ class DocumentPrivate;
+ 
++class JSTimerCache
++{
++public:
++    ~JSTimerCache();
++    void insert(const int id, QTimer *timer)
++    {
++        timerCache.insert(id, timer);
++    }
++    void remove(const int id)
++    {
++        timerCache.remove(id);
++    }
++    QTimer *value(const int id)
++    {
++        return timerCache.value(id);
++    }
++private:
++    QHash<int, QTimer *> timerCache;
++};
++
+ class JSApp
+ {
+ public:
+     static void initType(KJSContext *ctx);
+     static KJSObject object(KJSContext *ctx, DocumentPrivate *doc);
+-    static KJSObject wrapTimer(KJSContext *ctx, QTimer *timer);
+-    static void clearCachedFields();
++    static KJSObject wrapTimer(KJSContext *ctx, QTimer *timer, std::shared_ptr<JSTimerCache> &m_timerCache);
+ };
+ 
+ }
diff -Nru okular-22.12.3/debian/patches/series okular-22.12.3/debian/patches/series
--- okular-22.12.3/debian/patches/series	2026-06-08 20:02:26.000000000 +0800
+++ okular-22.12.3/debian/patches/series	2026-11-29 23:44:53.000000000 +0800
@@ -1 +1,2 @@
 fax-security.patch
+CVE-2026-124454.patch
-------------------------------------------------------------------------
Debian LTS Advisory DLA-XXXX-1                [email protected]
https://www.debian.org/lts/security/                     Maytham Alsudany
November 30, 2026                             https://wiki.debian.org/LTS
-------------------------------------------------------------------------

Package        : okular
Version        : 4:22.12.3-1+deb12u2
CVE ID         : CVE-2026-124454

A security vulnerability was discovered in Okular, KDE's universal
document viewer, which could lead to arbitrary code execution when
opening a specially crafted PDF file.

For Debian 12 bookworm, this problem has been fixed in version
4:22.12.3-1+deb12u2.

We recommend that you upgrade your okular packages.

For the detailed security status of okular please refer to
its security tracker page at:
https://security-tracker.debian.org/tracker/okular

Further information about Debian LTS security advisories, how to apply
these updates to your system and frequently asked questions can be
found at: https://wiki.debian.org/LTS

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to