Skip to content
~/ahmedeaygoren.dev
← Back to Advisories
CVE-2026-121267•Pardus eta-remote•High · CVSS 7.8PatchedCWE-276•2026-11-10

Overly Permissive Polkit Policy & Embedded Python Patch Bypass Leading to Cross-Session uinput LPE

Permissive Polkit defaults allow unprivileged non-active local users to invoke root uinput injection via pkexec, and the initial C wrapper patch using Py_Initialize() was bypassed via PYTHONPATH/usercustomize injection.

CNA
T.C. Cumhurbaşkanlığı Siber Güvenlik Başkanlığı (USOM TR-26-1498)
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Overview

To simulate keyboard and pointer input through /dev/uinput, Pardus eta-remote spawns /usr/share/eta/eta-remote/client/actions.py with root privileges via pkexec. An overly permissive Polkit configuration (CWE-276) allowed unprivileged, non-active local users to run actions.py as uid=0 without authentication and inject keystrokes into the active desktop session. Furthermore, the initial mitigation—embedding the launcher in a compiled C binary and verifying /proc/<ppid>/exe—remained vulnerable to Python environment injection.

Affected Components

Root Cause & Initial Patch Bypass

1. Permissive Polkit Policy & Cross-Session uinput Injection

The original Polkit policy granted passwordless pkexec execution across all sessions:

<!-- data/org.pardus.eta-remote.uinput.policy (Vulnerable) -->
<defaults>
  <allow_any>yes</allow_any>
  <allow_inactive>yes</allow_inactive>
  <allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/eta/eta-remote/client/actions.py</annotate>

Because <allow_any>yes</allow_any> and <allow_inactive>yes</allow_inactive> were enabled, any low-privileged or SSH user could run pkexec /usr/share/eta/eta-remote/client/actions.py as root and feed Base64-encoded JSON keyboard events over stdin. The kernel created a virtual eta-remote-virtual-input device whose keystrokes bypassed Wayland/X11 window isolation and landed directly in the active graphical user session.

2. Initial C Wrapper Patch Bypass (a6d02bb, 0946d7d, 8e8cdf5)

The initial patch replaced eta-remote.py.in with a compiled C launcher (eta-remote.c.in -> /usr/bin/eta-remote) and added an auth_process() check in actions.py validating the parent /proc/<ppid>/exe inode (st_ino / st_dev) against /usr/bin/eta-remote.

However, eta-remote.c.in initialized Python using Py_Initialize() while <allow_any>yes</allow_any> remained active:

// Initial Patch: eta-remote.c.in (Bypassable)
#include <Python.h>

int main(int argc, char *argv[]) {
    Py_Initialize();
    PyRun_SimpleString(
        "import sys\n"
        "sys.path.insert(0, '/usr/share/eta/eta-remote')\n"
        "import Main\n"
    );
    Py_Finalize();
    return 0;
}

Because Py_Initialize() honors PYTHONPATH, PYTHONHOME, and user site hooks (sitecustomize.py / ~/.local/lib/python3.x/site-packages/usercustomize.py) before executing PyRun_SimpleString, an attacker could execute arbitrary Python code inside the legitimate /usr/bin/eta-remote ELF process. At the OS level, /proc/<ppid>/exe still pointed to the genuine /usr/bin/eta-remote binary, completely bypassing auth_process().

Final Remediation (3b098ef & a590afd)

The complete fix submitted and merged upstream hardened all three layers:

  1. PEP 587 PyConfig Interpreter Isolation (eta-remote.c.in): Replaced Py_Initialize() with PyConfig disabling environment variables, user site directories, and argv parsing, alongside a sanitized sys.path:
// Hardened Final Code: eta-remote.c.in
PyStatus status;
PyConfig config;
PyConfig_InitPythonConfig(&config);
config.use_environment = 0;      // Disable PYTHONPATH, PYTHONHOME, etc.
config.user_site_directory = 0;  // Disable ~/.local/.../usercustomize.py
config.parse_argv = 0;

status = Py_InitializeFromConfig(&config);
if (PyStatus_Exception(status)) {
    PyConfig_Clear(&config);
    Py_ExitStatusException(status);
}
PyConfig_Clear(&config);

PyRun_SimpleString(
    "import sys\n"
    "sys.path = ['@pkgdatadir@'] + [p for p in sys.path if p != '' and not p.startswith('/home') and not p.startswith('/tmp')]\n"
    "import Main\n"
);
  1. Strict Polkit Seat Enforcement (data/org.pardus.eta-remote.uinput.policy): Locked <allow_any>no</allow_any> and <allow_inactive>no</allow_inactive> so non-active/SSH sessions cannot invoke pkexec without authentication.
  2. Process Tree Verification (src/client/actions.py): Targeted /usr/bin/python3 instead of sys.executable inside PipeUInputHandler and updated auth_process() to verify the caller process chain safely.

References