Execution of externally controlled command
Command argument from an unsecure source vulnerable to operating system command injection
Description
This defect occurs when commands are fully or partially constructed from externally controlled input.
Risk
Attackers can use the externally controlled input as operating system commands, or arguments to the application. An attacker could read or modify sensitive data can be read or modified, execute unintended code, or gain access to other aspects of the program.
Fix
Validate the inputs to allow only intended input values. For example, create a list of acceptable inputs and compare the input against this list.
Extend Checker
By default, Polyspace® assumes that data from external sources are tainted. See Sources of Tainting in a Polyspace Analysis. To consider
any data that does not originate in the current scope of Polyspace analysis as
tainted, use the command line option -consider-analysis-perimeter-as-trust-boundary
.
Examples
Result Information
Group: Tainted Data |
Language: C | C++ |
Default: Off |
Command-Line Syntax: TAINTED_EXTERNAL_CMD |
Impact: Medium |
Version History
Introduced in R2015b
See Also
Use of externally controlled environment variable
| Host change using externally controlled elements
| Command executed from externally controlled path
| Library loaded from externally controlled path
| Execution of a binary from a relative path can be controlled by an external actor
| Find defects (-checkers)
| -consider-analysis-perimeter-as-trust-boundary
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)
- Sources of Tainting in a Polyspace Analysis
- Modify Default Behavior of Bug Finder Checkers