Skip to content

fix: the processutils in ProcessUtils.java - #2557

Merged
RohitKushvaha01 merged 1 commit into
Acode-Foundation:mainfrom
anupamme:fix-repo-acode-command-injection-process-utils
Jul 31, 2026
Merged

fix: the processutils in ProcessUtils.java#2557
RohitKushvaha01 merged 1 commit into
Acode-Foundation:mainfrom
anupamme:fix-repo-acode-command-injection-process-utils

Conversation

@anupamme

Copy link
Copy Markdown
Contributor

Summary

Fix critical severity security issue in src/plugins/terminal/src/android/ProcessUtils.java.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File src/plugins/terminal/src/android/ProcessUtils.java:45
Assessment Likely exploitable

Description: The ProcessUtils.killProcessTree() and killProcess() methods construct shell commands by concatenating the process ID (pid) directly into a command string passed to Runtime.getRuntime().exec(). The exec(String) method invokes a shell, allowing shell metacharacters in the pid to chain arbitrary commands if the pid value is influenced by user input or external data.

Evidence

Exploitation scenario: An attacker who can influence the pid parameter (e.g., through crafted process or process enumeration manipulation) can inject shell metacharacters.

Scanner confirmation: multi_agent_ai rule V-001 flagged this pattern.

Production code: This file is in the production codebase, not test-only code.

Threat Model Context

This is a Node.js library - vulnerabilities affect downstream consumers who use this package.

Changes

  • src/plugins/terminal/src/android/ProcessUtils.java

Behavior Preservation

The change is scoped to 1 file on the vulnerable path, and the project builds successfully with this change applied.

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Replaces string-based Runtime.exec calls with explicit argument arrays when terminating individual processes and process groups, preserving existing command semantics while avoiding command-string parsing.

Confidence Score: 5/5

The PR appears safe to merge with no identified functional or security regressions.

The changed array-based process execution produces the same arguments as the previous commands for numeric PIDs, while avoiding unsafe command-string construction.

Important Files Changed

Filename Overview
src/plugins/terminal/src/android/ProcessUtils.java Both process-kill paths now pass fixed command arguments separately; realistic callers provide numeric PIDs, so behavior remains equivalent without introducing a reachable regression.

Reviews (1): Last reviewed commit: "fix: V-001 security vulnerability" | Re-trigger Greptile

@RohitKushvaha01
RohitKushvaha01 added this pull request to the merge queue Jul 31, 2026
Merged via the queue into Acode-Foundation:main with commit 5110e1f Jul 31, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jul 31, 2026
@UnschooledGamer UnschooledGamer moved this from Done to 🫡 Done by Community in The Code Board - Acode Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🫡 Done by Community

Development

Successfully merging this pull request may close these issues.

3 participants