Cloudanix VulnDB

CVE-2022-24986

High · 7.8

CVSS

7.8

EPSS

0.3%

Published

Feb 26, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A scheduling tool on Linux desktops can be tricked by another user on the same computer into running the attacker's commands instead of the intended ones.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Full Compromise
Component
Application
Class
Race Condition
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Insecure reuse of a predictable temporary filename in /tmp during KCron editing sessions creates a time-of-check-to-time-of-use race condition that allows an attacker to replace the file contents between creation and execution.

Why it matters to the business

Local users can gain the ability to execute arbitrary commands with the privileges of the KCron process owner, potentially leading to full system compromise on multi-user Linux desktops or servers that rely on this cron editor.

How an attack unfolds

An attacker with local access monitors /tmp for the initial creation of the KCron temporary file, records its name, then prepares a symlink or malicious replacement file with the same name; on the next save operation within the same editing session the malicious file is consumed and its commands are scheduled.

How to fix it

Upgrade KDE KCron to a version that uses secure temporary file handling such as mkstemp or a private directory; if no updated package is available, replace KCron with an alternative cron editor that avoids predictable /tmp filenames.

How to confirm the fix worked

Inspect the KCron source or running process to confirm temporary files are created with mkstemp or O_EXCL flags and are placed outside world-writable directories; test by attempting concurrent file creation with the same name.

Typical attack path

  1. Obtain local user access on the target system
  2. Monitor /tmp directory for KCron temporary file creation events
  3. Capture the exact filename used in the first save
  4. Create a symlink or malicious file using the captured name before the next edit
  5. Trigger or wait for the user to perform a subsequent save in KCron
  6. Verify the attacker-controlled commands have been added to the crontab

How to detect it

Search system logs and file creation events in /tmp for repeated or predictable filenames matching KCron session patterns; examine crontab entries added during active editing sessions for unexpected commands.

What your security team should do

  • Remove or restrict local interactive access for untrusted users on systems running KCron
  • Audit all systems for presence of KDE KCron and schedule replacement with a maintained cron editor
  • Enable filesystem monitoring on /tmp to alert on unexpected file creation by cron-related processes
  • Review existing crontabs for any unauthorized entries that may indicate prior exploitation

The record

KDE KCron through 21.12.2 uses a temporary file in /tmp when saving, but reuses the filename during an editing session. Thus, someone watching it be created the first time could potentially intercept the file the following time, enabling that person to run unauthorized commands.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 kcron 0 No fix
Debian:12 kcron 0 4:21.12.3-1
Debian:13 kcron 0 4:21.12.3-1
Ubuntu:16.04:LTS kcron 0 No fix
Ubuntu:18.04:LTS kcron 0 No fix
Ubuntu:20.04:LTS kcron 0 No fix
Ubuntu:22.04:LTS kcron 0 No fix
Ubuntu:24.04:LTS kcron 0 No fix
Ubuntu:24.10 kcron 0 No fix
Ubuntu:25.04 kcron 0 No fix
Ubuntu:25.10 kcron 0 No fix
Ubuntu:Pro:16.04:LTS kcron 0 No fix
Ubuntu:Pro:18.04:LTS kcron 0 No fix
Ubuntu:Pro:20.04:LTS kcron 0 No fix

Related vulnerabilities