Taint Sources for CodeSonar C# Warning Classes
Taint sources are locations where data from an untrusted origin
may enter a program. Such data can be used to construct injection
attacks.
This section lists the methods that the CodeSonar C#
analysis automatically recognizes as sources, and explains how to
specify additional methods that the analysis should treat as
sanitizers.
Taint sources are locations where data from an untrusted origin
may enter a progam. This tainted data can be used to
construct injection attacks, unless it is subsequently sanitized.
If you have a method that is a taint source but not automatically recognized, you can instruct the
CodeSonar analysis to treat it as a source by applying one of
the following attributes.
| Attribute |
Notes |
| [com.juliasoft.julia.checkers.flows.UntrustedDatabase]
|
Results of database queries.
Taint of this kind is not tracked if CSHARP_ANALYSIS_TRUST_DATABASE=Yes. |
| [com.juliasoft.julia.checkers.flows.UntrustedDevice]
|
Data about the specific device where the program is running,
such as its phone number, its geographical location and its IMEI
code.
Taint of this kind is not tracked if CSHARP_ANALYSIS_TRUST_DEVICE=Yes. |
| [com.juliasoft.julia.checkers.flows.UntrustedEnvironment]
|
Files from the file system, system properties and arguments
to main methods.
Taint of this kind is not tracked if CSHARP_ANALYSIS_TRUST_ENVIRONMENT=Yes. |
| [com.juliasoft.julia.checkers.flows.UntrustedExternalStream]
|
Input streams from sockets or URL are considered as source
locations of untrusted data.
Taint of this kind is not tracked if CSHARP_ANALYSIS_TRUST_EXTERNAL_STREAMS=Yes. |
| [com.juliasoft.julia.checkers.flows.UntrustedUserInput]
|
Request objects to servlets and input read from console are
considered as source locations of untrusted data.
Taint of this kind is not tracked if CSHARP_ANALYSIS_TRUST_USER_INPUT=Yes. |
The methods listed below are automatically recognized as taint
sources by CodeSonar. The relevant annotation from the table above is shown for
each method.
- [return: UntrustedDevice] Location
android.location.LocationManager.getLastKnownLocation(String
arg0)
- [return: UntrustedDevice] String
android.location.LocationProvider.getName()
- [return: UntrustedEnvironment] String
android.os.SystemProperties.get(String arg0, String arg1)
- [return: UntrustedEnvironment] String
android.os.SystemProperties.get(String arg0)
- [return: UntrustedDevice] CellLocation
android.telephony.TelephonyManager.getCellLocation()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceId()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceSoftwareVersion()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getLine1Number()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperatorName()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getPhoneType()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperatorName()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimSerialNumber()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getVoiceMailNumber()
- [return: UntrustedUserInput] Editable
android.widget.EditText.getText()
- void
com.openxc.VehicleLocationProvider.receive([UntrustedDevice]
Measurement arg0)
- void
com.openxc.VehicleManager.Listener.receive([UntrustedDevice]
VehicleMessage arg0)
- [return: UntrustedDevice] VehicleMessage
com.openxc.VehicleManager.get(MessageKey arg0)
- [return: UntrustedDevice] Measurement
com.openxc.VehicleManager.get(Class arg0)
- [return: UntrustedDevice] String
com.openxc.VehicleManager.getVehicleInterfaceDeviceId()
- [return: UntrustedDevice] String
com.openxc.VehicleManager.getVehicleInterfacePlatform()
- [return: UntrustedDevice] String
com.openxc.VehicleManager.getVehicleInterfaceVersion()
- [return: UntrustedDevice] VehicleMessage
com.openxc.VehicleManager.request(KeyedMessage arg0)
- void
com.openxc.measurements.Measurement.Listener.receive([UntrustedDevice]
Measurement arg0)
- void
com.openxc.messages.VehicleMessage.Listener.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.AbstractQueuedCallbackSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.ContextualVehicleDataSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.FileRecorderSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.MessageListenerSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.RemoteCallbackSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void com.openxc.sinks.TestSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.UploaderSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void com.openxc.sinks.UserSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sinks.VehicleDataSink.receive([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.ApplicationSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.BaseVehicleDataSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.BytestreamDataSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.ContextualVehicleDataSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.NativeLocationSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.RemoteListenerSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.SourceCallback.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.TestSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- void
com.openxc.sources.VehicleDataSource.handleMessage([UntrustedDevice]
VehicleMessage arg0)
- [return: UntrustedDevice] List
android.telephony.TelephonyManager.getAllCellInfo()
- [return: UntrustedDevice] CellLocation
android.telephony.TelephonyManager.getCellLocation()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceId()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceSoftwareVersion()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getLine1Number()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperatorName()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getPhoneType()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperatorName()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimSerialNumber()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getVoiceMailNumber()
- [return: UntrustedDevice] List
android.telephony.TelephonyManager.getAllCellInfo()
- [return: UntrustedDevice] CellLocation
android.telephony.TelephonyManager.getCellLocation()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceId(int arg0)
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceId()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceSoftwareVersion()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getLine1Number()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperatorName()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getPhoneCount()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getPhoneType()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperatorName()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimSerialNumber()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getVoiceMailNumber()
- [return: UntrustedDevice] List
android.telephony.TelephonyManager.getAllCellInfo()
- [return: UntrustedDevice] CellLocation
android.telephony.TelephonyManager.getCellLocation()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getDataNetworkType()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceId(int arg0)
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceId()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getDeviceSoftwareVersion()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getLine1Number()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getNetworkOperatorName()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getPhoneCount()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getPhoneType()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimCountryIso()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperator()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimOperatorName()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getSimSerialNumber()
- [return: UntrustedDevice] String
android.telephony.TelephonyManager.getVoiceMailNumber()
- [return: UntrustedDevice] int
android.telephony.TelephonyManager.getVoiceNetworkType()
- [return: UntrustedDatabase] SqlDataReader
System.Data.SqlClient.SqlCommand.ExecuteReader()
- [return: UntrustedDatabase] SqlDataReader
System.Data.SqlClient.SqlCommand.ExecuteReader(int arg0)
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteReaderAsync(int arg0,
CancellationToken arg1)
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteReaderAsync(CancellationToken
arg0)
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteReaderAsync()
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteReaderAsync(int arg0)
- [return: UntrustedDatabase] Object
System.Data.SqlClient.SqlCommand.ExecuteScalar()
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteScalarAsync(CancellationToken
arg0)
- [return: UntrustedDatabase] XmlReader
System.Data.SqlClient.SqlCommand.ExecuteXmlReader()
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync(CancellationToken
arg0)
- [return: UntrustedDatabase] Task_1
System.Data.SqlClient.SqlCommand.ExecuteXmlReaderAsync()
- [return: UntrustedUserInput] HttpContext
System.Web.HttpRequest.get_Context()
- [return: UntrustedUserInput] HttpCookieCollection
System.Web.HttpRequest.get_Cookies()
- [return: UntrustedUserInput] NameValueCollection
System.Web.HttpRequest.get_Form()
- [return: UntrustedUserInput] NameValueCollection
System.Web.HttpRequest.get_Headers()
- [return: UntrustedUserInput] String
System.Web.HttpRequest.get_Item(String arg0)
- [return: UntrustedUserInput] Page
System.Web.HttpRequest.get_Page()
- [return: UntrustedUserInput] NameValueCollection
System.Web.HttpRequest.get_Params()
- [return: UntrustedUserInput] int
System.Console.ReadKey()
- [return: UntrustedUserInput] ConsoleKeyInfo
System.Console.ReadKey(boolean arg0)
- [return: UntrustedUserInput] String
System.Console.ReadLine()
- [return: UntrustedUserInput] TextReader
System.Diagnostics.Process.get_StandardError()
- [return: UntrustedUserInput] TextReader
System.Diagnostics.Process.get_StandardOutput()
- IAsyncResult
System.IO.Stream.BeginRead([UntrustedExternalStream] byte[]
arg0, int arg1, int arg2, AsyncCallback arg3, Object arg4)
- int System.IO.Stream.Read([UntrustedExternalStream]
byte[] arg0, int arg1, int arg2)
- Task_1
System.IO.Stream.ReadAsync([UntrustedExternalStream] byte[]
arg0, int arg1, int arg2)
- Task_1
System.IO.Stream.ReadAsync([UntrustedExternalStream] byte[]
arg0, int arg1, int arg2, CancellationToken arg3)
- [return: UntrustedExternalStream] int
System.IO.Stream.ReadByte()
- [return: UntrustedUserInput] int
System.IO.TextReader.Peek()
- [return: UntrustedUserInput] int
System.IO.TextReader.Read()
- [return: UntrustedUserInput] String
System.IO.TextReader.ReadLine()
- [return: UntrustedUserInput] Task
System.IO.TextReader.ReadLineAsync()
- [return: UntrustedUserInput] String
System.IO.TextReader.ReadToEnd()
- [return: UntrustedUserInput] Task
System.IO.TextReader.ReadToEndAsync()
- [return: UntrustedExternalStream] WebRequest
System.Net.WebRequest.Create(String arg0)
- [return: UntrustedExternalStream] HttpWebRequest
System.Net.WebRequest.CreateHttp(String arg0)
- void System.Object.Main([UntrustedUserInput] String[]
arg0)