Difetti da dati contaminati
I difetti relativi a dati contaminati indicano l'utilizzo di dati contaminati in determinate operazioni. I dati provenienti da sorgenti non sicure sono dati contaminati. Polyspace® considera non sicure le seguenti sorgenti:
Oggetti volatili.
Input esterni ottenuti utilizzando funzioni della libreria standard. Gli input esterni possono includere:
Input da parte dell'utente
Variabili di ambiente
Contenuto del file o percorso del file
Dati ottenuti dall'hardware
Prima di utilizzare i dati, validare i dati contaminati ottenuti da tali sorgenti non sicure. Gli aggressori malintenzionati possono utilizzare i dati contaminati che non sono stati validati per attaccare il programma e causare anomalie. I difetti relativi a dati contaminati indicano l'utilizzo di dati contaminati che non sono stati validati in determinate operazioni. Ad esempio, Polyspace indica:
Dati contaminati in diverse operazioni numeriche.
Elementi controllati esternamente, quali percorsi, comandi, variabili di ambiente e ID host.
Dati contaminati in operazioni di memoria quali allocazione e dereferenziazione.
Risultati di Polyspace
Array access with tainted index | Array index from unsecure source possibly outside array bounds |
Command executed from externally controlled path | Path argument from an unsecure source |
Execution of externally controlled command | Command argument from an unsecure source vulnerable to operating system command injection |
Host change using externally controlled elements | Changing host ID from an unsecure source |
Library loaded from externally controlled path | Using a library argument from an externally controlled path |
Loop bounded with tainted value | Loop controlled by a value from an unsecure source |
Memory allocation with tainted size | Size argument to memory function is from an unsecure source |
Pointer dereference with tainted offset | Offset is from an unsecure source and dereference might be out of bounds |
Tainted division operand | Operands of division operation (/) come from an unsecure
source |
Tainted modulo operand | Operands of remainder operation (%) come from an unsecure
source |
Tainted NULL or non-null-terminated string | Argument is from an unsecure source and might be NULL or not NULL-terminated |
Tainted sign change conversion | Value from an unsecure source changes sign |
Tainted size of variable length array | Size of the variable-length array (VLA) is from an unsecure source and might be zero, negative, or too large |
Tainted source used with sensitive function | Data obtained from an untrusted source is passed to user-defined sensitive function (Da R2023b) |
Tainted string format | Input format argument is from an unsecure source |
Use of externally controlled environment variable | Value of environment variable is from an unsecure source |
Use of tainted pointer | Pointer from an unsecure source may be NULL or point to unknown memory |
Argomenti
- Sources of Tainting in a Polyspace Analysis
Validate tainted data obtained from external sources to avoid security risks.
- Bug Finder Defect Groups
The Bug Finder defect checkers are classified into groups such as data flow, concurrency, numerical, and so on.