Primitives for modeling sources of untrusted (tainted) data

Coverity Documentation

Version
latest

The following C# and Visual Basic security primitives model untrusted data sources:

No parameter Parameter
Security.HttpSource() Security.HttpSource(Object)
Security.HttpMapValuesSource() Security.HttpMapValuesSource(Object)
Security.NetworkSource() Security.NetworkSource(Object)
Security.DatabaseSource() Security.DatabaseSource(Object)
Security.FileSystemSource() Security.FileSystemSource(Object)
Security.ConsoleSource() Security.ConsoleSource(Object)
Security.EnvironmentSource() Security.EnvironmentSource(Object)
Security.SystemPropertiesSource() Security.SystemPropertiesSource(Object)
Security.RpcSource() Security.RpcSource(Object)
Security.CookieSource() Security.CookieSource(Object)

As the table shows, each primitive is one of a pair. The primitives that do not take an argument model a method that returns a string-like or simple collection object: analysis treats this object as tainted data. The primitives that take an Object argument model a method that taints a string-like or simple collection parameter, presumably by inserting a tainted string or sequence of characters into it. The primitive argument must be one of the modelled method's parameters.

Each variant corresponds to a particular taint type that can be trusted or distrusted using the cov-analyze command's trust or distrust command-line options; for example, --trust-http and --distrust-http. These options are described in the Coverity Command Reference.