[KongchangAI]
ConceptCommand Injection / Shell注入

Command Injection

A security vulnerability type in which an attacker embeds shell metacharacters in input data, causing a program to execute that data as shell commands. It commonly occurs when user input is directly concatenated into shell command strings without proper sanitization.

Timeline (last 90 days)

Oct 11

Command injection is a vulnerability in which an attacker embeds shell metacharacters (such as ;, &&, |, $()) in input data, causing the string to be interpreted by the shell parser as additional commands to execute.

Unverified50%
Oct 11

The correct approach to fixing command injection is to use execFile with a separate argument array, reject non-compliant branch text with a strict regular expression, and set a timeout.

Unverified50%
Oct 11

The approach to fixing code should preserve the business objective (such as tool name, execution order, and timeout requirements) while replacing the dangerous mechanism (such as template strings, the shell: true flag, and dependencies that wrap a shell).

Unverified50%

All Facts (3)

Source Articles