CVE-2022-27815: Insecure Temporary File in SWHKD
9.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.46035%
CWE
Published
3/31/2022
Updated
1/27/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
Simple-Wayland-HotKey-Daemon | rust | < 1.2.0 | 1.2.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the insecure use of /tmp/swhkd.pid
path in the main()
function of daemon.rs
. The commit diff shows the PID file path was modified from '/tmp/swhkd.pid' to a user-specific '/etc/swhkd/runtime' location. The main()
function's PID file handling (existence check, read/write operations) using a world-writable /tmp
location made it vulnerable to race conditions and symlink attacks. The direct modification of this path in the patch confirms this was the vulnerable code section.