sink
In taint analysis, a function where untrusted data becomes dangerous, such as os.system, eval or a raw SQL call.
In more detail
Replacing a dangerous sink with a safe construction, such as subprocess.run with a list of arguments, gives the scanner something it can verify. Sanitising input before a sink is harder to prove.
Example
The course's fix replaces the shell sink with subprocess.run and a list of arguments, which the scanner can verify as safe.Related terms
- taint analysis — Tracking untrusted data from where it enters (a source) to where it would be dangerous (a sink), unless it passes a sanitiser first.
- command injection — An attack where input meant as data, such as a file name or form field, gets run as commands because a program built code from it.
Taught in
- Static Application Security Testing — Application Security & Threat Modeling for Engineers