/

CVE-2026-117558

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in ai-sdlc MCP Server

CVE-2026-117558

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The ai-sdlc MCP server through version 0.31.2 contains an OS command injection flaw in handling the repository argument. An attacker who can influence that argument, including through a prompt-injected agent, may cause arbitrary commands to run with the privileges of the MCP server user.

The ai-sdlc MCP server through version 0.31.2 contains an OS command injection flaw in handling the repository argument. An attacker who can influence that argument, including through a prompt-injected agent, may cause arbitrary commands to run with the privileges of the MCP server user.

Affected context

The vulnerability occurs when the MCP server processes repository-related requests and constructs gh issue view or gh pr view commands. Risk increases when repository arguments can be influenced by untrusted users, external content, or prompt-injected agents and are passed to a shell without validation or safe argument handling.

The vulnerability occurs when the MCP server processes repository-related requests and constructs gh issue view or gh pr view commands. Risk increases when repository arguments can be influenced by untrusted users, external content, or prompt-injected agents and are passed to a shell without validation or safe argument handling.

Exploit preconditions

  • Attack surface: MCP server tools that retrieve GitHub issue or pull request information
  • Required access: Ability to submit or influence the repository argument, directly or through an agent
  • Trigger point: Execution of the constructed gh issue view or gh pr view command
  • Why exploitation is possible: The repository value is interpolated into a shell command and executed through execSync() without adequate validation or shell-safe argument handling
  • Attack surface: MCP server tools that retrieve GitHub issue or pull request information
  • Required access: Ability to submit or influence the repository argument, directly or through an agent
  • Trigger point: Execution of the constructed gh issue view or gh pr view command
  • Why exploitation is possible: The repository value is interpolated into a shell command and executed through execSync() without adequate validation or shell-safe argument handling

Why this happens

The underlying bug is OS command injection caused by combining untrusted input with a shell command. Shell metacharacters in the repository argument may alter command interpretation when the value is interpolated into a string passed to execSync(). This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because input is not reliably separated from command syntax before execution.

The underlying bug is OS command injection caused by combining untrusted input with a shell command. Shell metacharacters in the repository argument may alter command interpretation when the value is interpolated into a string passed to execSync(). This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because input is not reliably separated from command syntax before execution.

Potential impact

  • An attacker may execute arbitrary operating-system commands
  • Commands could run with the privileges of the MCP server user
  • Repository credentials, environment variables, or local files could be exposed
  • The MCP server runtime could be modified or disrupted
  • The compromised process could be used for lateral movement, depending on available permissions
  • An attacker may execute arbitrary operating-system commands
  • Commands could run with the privileges of the MCP server user
  • Repository credentials, environment variables, or local files could be exposed
  • The MCP server runtime could be modified or disrupted
  • The compromised process could be used for lateral movement, depending on available permissions

General mitigation guidance

Mitigation generally focuses on preventing untrusted values from being interpreted as shell syntax.

Common defensive patterns include:

  • Avoiding shell invocation when a direct process API can be used
  • Passing command arguments as structured arrays rather than interpolated command strings
  • Applying strict allowlists for repository, owner, issue, and pull request identifiers
  • Rejecting unexpected characters and enforcing expected input formats before command execution
  • Separating agent-generated content from trusted operational parameters
  • Running the MCP server with least-privilege accounts and minimal filesystem and network permissions
  • Limiting access to GitHub tokens and other process environment secrets

Mitigation generally focuses on preventing untrusted values from being interpreted as shell syntax.

Common defensive patterns include:

  • Avoiding shell invocation when a direct process API can be used
  • Passing command arguments as structured arrays rather than interpolated command strings
  • Applying strict allowlists for repository, owner, issue, and pull request identifiers
  • Rejecting unexpected characters and enforcing expected input formats before command execution
  • Separating agent-generated content from trusted operational parameters
  • Running the MCP server with least-privilege accounts and minimal filesystem and network permissions
  • Limiting access to GitHub tokens and other process environment secrets

How teams detect issues like this

Organizations can identify this weakness through:

  • Static analysis rules for execSync(), shell execution APIs, and string interpolation involving external input
  • Code review checks for command construction using template literals or concatenation
  • Tests that submit metacharacters and unexpected delimiters to command-related tool arguments
  • Runtime monitoring for unusual child processes, command arguments, and outbound activity from the MCP server
  • Policy enforcement requiring structured process APIs and approved input validation utilities

Automated security review tools may help flag shell execution paths, but findings should be validated against the actual trust boundary and execution environment.

Organizations can identify this weakness through:

  • Static analysis rules for execSync(), shell execution APIs, and string interpolation involving external input
  • Code review checks for command construction using template literals or concatenation
  • Tests that submit metacharacters and unexpected delimiters to command-related tool arguments
  • Runtime monitoring for unusual child processes, command arguments, and outbound activity from the MCP server
  • Policy enforcement requiring structured process APIs and approved input validation utilities

Automated security review tools may help flag shell execution paths, but findings should be validated against the actual trust boundary and execution environment.

Sources

SourceLink
github.comgithub.com/ai-sdlc-framework/ai-sdlc
github.comgithub.com/ai-sdlc-framework/ai-sdlc/blob/ai-sdlc-plugin-v0.31.2/ai-sdlc-plugin/mcp-server/src/tools/check-issue.ts#L15-L19
github.comgithub.com/ai-sdlc-framework/ai-sdlc/commit/717d7ecf068b714f65955e50fcf5cb4f9a0b5070
github.comgithub.com/ai-sdlc-framework/ai-sdlc/issues/1970
vulncheck.comvulncheck.com/advisories/ai-sdlc-mcp-server-through-0.31.2-command-injection-via-check-issue-and-check-pr-status

Frequently asked

questions

It may be exploitable through an MCP client or agent if an attacker can influence the repository argument and cause the affected tool to run. The exact reachability depends on how the MCP server is exposed and how requests are authorized.

Usually, some ability to invoke the relevant MCP tool or influence an agent that invokes it is required. Authentication and authorization controls can limit who reaches the vulnerable command path but do not make unsafe command construction secure.

Avoid shell-based command construction, use a direct process execution interface with separately supplied arguments, and enforce strict validation for repository identifiers and related parameters.

Treat agent-generated and user-provided values as untrusted, apply allowlist validation, review all operating-system execution paths, and run services with minimal privileges and narrowly scoped credentials.

It may be exploitable through an MCP client or agent if an attacker can influence the repository argument and cause the affected tool to run. The exact reachability depends on how the MCP server is exposed and how requests are authorized.

Usually, some ability to invoke the relevant MCP tool or influence an agent that invokes it is required. Authentication and authorization controls can limit who reaches the vulnerable command path but do not make unsafe command construction secure.

Avoid shell-based command construction, use a direct process execution interface with separately supplied arguments, and enforce strict validation for repository identifiers and related parameters.

Treat agent-generated and user-provided values as untrusted, apply allowlist validation, review all operating-system execution paths, and run services with minimal privileges and narrowly scoped credentials.

Find out what's already
exploitable in your codebase.