Miggo Logo

CVE-2022-27816: Data Loss/Denial of Service in SWHKD

7.1

CVSS Score
3.1

Basic Information

EPSS Score
0.31794%
Published
3/31/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
Simple-Wayland-HotKey-Daemonrust< 1.2.01.2.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems directly from the hardcoded /tmp/swhks.pid path in src/server.rs shown in the commit diff. This violates CWE-59 by using a predictable temporary file path without proper safety checks, making it susceptible to symlink attacks. The patch moves the path to a user-specific /run/user/ directory, confirming this was the vulnerable code path. While no named functions are explicitly mentioned in the report, the main function's PID file handling is the root cause.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

SW*K* *.*.* uns***ly us*s t** /tmp/sw*ks.pi* p*t*n*m*. T**r* **n ** **t* loss or * **ni*l o* s*rvi**. * p*t** is *v*il**l* on t** `*.*.*` *r*n** o* t** r*pository.

Reasoning

T** vuln*r**ility st*ms *ir**tly *rom t** **r**o*** `/tmp/sw*ks.pi*` p*t* in `sr*/s*rv*r.rs` s*own in t** *ommit *i**. T*is viol*t*s *W*-** *y usin* * pr**i*t**l* t*mpor*ry *il* p*t* wit*out prop*r s***ty ****ks, m*kin* it sus**pti*l* to symlink *tt*