CVE-2022-27815
Rust vulnerability analysis and mitigation

Overview

SWHKD version 1.1.5 contains a security vulnerability (CVE-2022-27815) where the daemon running as root unsafely uses the /tmp/swhkd.pid pathname to record its own PID for instance monitoring. The vulnerability was discovered on March 22, 2022, and was publicly disclosed on April 14, 2022. The affected software is SWHKD, a hotkey helper for the Wayland graphics system written in Rust (OSS Security).

Technical details

The vulnerability stems from the daemon's use of a fixed path (/tmp/swhkd.pid) to record its PID for instance monitoring. When running as root, this implementation creates several security issues. The daemon logs the full content of the PID file to stdout, which can lead to information disclosure if the kernel's symlink protection is turned off. For example, if a symlink points to a private root-owned file containing sensitive information, the content would be logged (OSS Security).

Impact

The vulnerability has multiple potential impacts: 1) Local application DoS - an attacker can place the PID of an existing process in the file to prevent other users from starting the daemon, 2) Information leak if kernel symlink protection is disabled - the daemon logs the full content of the PID file, potentially exposing sensitive information, 3) System DoS - the daemon will overwrite the target file with its own PID, potentially creating world-readable files in sensitive locations, and 4) Functional issues - the setup is not suitable for multiple users using the software in parallel (OSS Security).

Mitigation and workarounds

The issue has been fixed in version 1.2.0 by moving the PID file to /etc/swhkd/runtime directory. The fix includes creating a proper directory structure with appropriate permissions (root:root ownership and 700 permissions). The patch implements a more secure approach by using a user-specific PID file path format: /etc/swhkd/runtime/swhkd_{uid}.pid (GitHub Commit, GitHub Release).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66627HIGH8.4
  • RustRust
  • wasmi
NoYesDec 09, 2025
GHSA-xrv8-2pf5-f3q7MEDIUM6
  • RustRust
  • nitro-tpm-pcr-compute
NoYesDec 05, 2025
CVE-2025-67487MEDIUM5.5
  • RustRust
  • static-web-server
NoYesDec 09, 2025
CVE-2025-66622LOW1.3
  • RustRust
  • matrix-sdk-base
NoYesDec 09, 2025
RUSTSEC-2025-0135N/AN/A
  • RustRust
  • matrix-sdk-base
NoYesDec 08, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management