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

Taught in

References