Skip to content

[Security] ProcessKiller.cs — KillProcessesUsingFile kills by name instead of PID #472

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Warning

File: src/Servy.Core/Helpers/ProcessKiller.cs, line 330

Description:
KillProcessesUsingFile calls KillProcessTreeAndParents(procInfo.ProcessName) using the process name returned by handle64.exe. If the name matches an unrelated system process (e.g., svchost, csrss), it will attempt to kill it.

procInfo.ProcessId is available from the parsed output but is not used. Killing by PID would be much safer and more precise.

Suggested fix:
Use KillProcessTreeAndParents with the process ID instead of the process name, or add a safelist check to prevent killing critical system processes.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions