Use of externally controlled environment variable
Value of environment variable is from an unsecure source
Description
This defect occurs when functions that add or change environment variables, such as
putenv
and setenv
, obtain new environment
variable values from unsecure sources.
Risk
If the environment variable is tainted, an attacker can control your system settings. This control can disrupt an application or service in potentially malicious ways.
Fix
Before using the new environment variable, check its value to avoid giving control to external users.
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_ENV_VARIABLE |
Impact: Medium |
Version History
Introduced in R2015b
See Also
Execution of externally controlled command
| Host change using externally controlled elements
| Command executed from externally controlled path
| Library loaded from externally controlled path
| 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