Skip to content

fix: some security stuff - #53

Merged
ariasmn merged 5 commits into
mainfrom
chore/fix-some-issues
Aug 15, 2026
Merged

fix: some security stuff#53
ariasmn merged 5 commits into
mainfrom
chore/fix-some-issues

Conversation

@ariasmn

@ariasmn ariasmn commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Some security stuff over the C code. I found two issues myself and got curious and asked DeepSeek V4 Pro for more input.

What I found was the PID check without upper bound which caused truncation. I then checked and was also present in the GUI obviously. What DeepSeek found (alongside a couple of false positives):

  • Terminal escape injection: process names come from /proc/pid/comm, which any process can set to arbitrary bytes via prctl(PR_SET_NAME). pidnl list printed them raw, so a process could inject ANSI/OSC sequences into the admin's terminal (same class as CVE-2023-4016 in ps). Control characters are now stripped when reading the name.
  • Protocol injection via executable paths: Linux filenames can contain newlines, and a process launched from such a path would desync the GUI's line-based protocol and misalign PIDs and limits. The same sanitization is applied to exe_path. (I actually tested myself and I couldn't believe lol)
  • Monitor socket directory: the monitor daemon used to trust an existing /run/pidnl without checking what it was: stat follows symlinks, and there was no ownership/type check before unlink/bind on the socket. Now it requires a real root-owned directory via lstat, or fails hard.

@ariasmn
ariasmn merged commit 935b828 into main Aug 15, 2026
3 checks passed
@ariasmn
ariasmn deleted the chore/fix-some-issues branch August 15, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant