Module cwe_checker_lib::checkers::cwe_676
source · Expand description
This module implements a check for CWE-676: Use of Potentially Dangerous Function.
Potentially dangerous functions like memcpy can lead to security issues like buffer overflows. See https://cwe.mitre.org/data/definitions/676.html for a detailed description.
How the check works:
- Calls to dangerous functions are flagged. The list of functions that are considered dangerous can be configured in config.json. The default list is based on https://github.com/01org/safestringlib/wiki/SDL-List-of-Banned-Functions.
False Positives
- None known
False Negatives
- None known
Structs
- struct containing dangerous symbols from config.json
Statics
- The module name and version
Functions
- Iterate through all function calls inside the program and flag calls to those functions that are marked as unsafe via the configuration file.
- Generate cwe warnings for potentially dangerous function calls
- For each subroutine and each found dangerous symbol, check for calls to the corresponding symbol
- Filter external symbols by dangerous symbols