Secure connection option settings
- Last Updated: January 25, 2024
- 3 minute read
- DataDirect Connectors
- ODBC
- Aha! 8.0
- Amazon Redshift 8.0
- Apache Cassandra 8.0
- Apache Hive 8.0
- Apache Spark SQL 8.0
- Autonomous Rest Connector 8.0
- Cloudera Impala 7.1
- dBase 7.1
- + 24
DataDirect for ODBC drivers use connection options to configure driver behavior and connection settings. Although applications often require end users to provide information that is used to configure these options and establish a connection, it is important to control which options are configurable by the end user, validate the values provided, and restrict access to only approved users. Failure to do so can potentially expose security vulnerabilities and introduce behavior that the application has not been tested against.
The following section describes some steps you can take to protect your connection option values as well as a list of common connection options that to which you should restrict access.
Secure the connection string
If your application allows end users to configure the ODBC connection, it is important to secure that configuration. The settings of connection options can impact the security of a solution using an ODBC driver. It is important to have protections in place to restrict which connection options a user can set as well as validating the values supplied.
Connection option whitelists
There are a couple ways that your application can restrict the connection options specified by the user. One method is to provide an interface that exposes only options that you trust the user to configure, such as a dialog with a set of fields. The other approach is to allow the user to supply a complete connection string that the application validates against a whitelist.
If your application allows users to provide a connection string, you should limit which connection options they can set by employing a whitelist within the ODBC application. The list of supported connection options for a driver should be reviewed to assemble the whitelist. For a list of supported connection options, refer to the "Connection option descriptions" section in the user's guide for your driver.
Deployment-specific validation of connection option values
After creating and implementing a whitelist of connection options that can be set by the
user, you should consider additional validation of the values for those options. For
instance, the connection option TrustStore accepts a file path; therefore,
you may need to add validation to ensure the specified path aligns with the expectations
appropriate for your application and deployment.
Validate connection option values to prevent injection
HostName option:
192.168.1.123;encryptionMethod=0
In this case, in addition to specifying the host, the user also set the connection option to disable encryption. Note that ODBC connection string builds are available in some languages and often protect against such attacks. The complete syntax of the connection string can be found under the SQLDriverConnect function description in the ODBC API.
Connection options that require restricted access
The lists in this section document common connection options that we recommend that you restrict end users from configuring. Note that this is not an exhaustive list of options for which you should restrict user access. Depending on how your application uses functionality controlled by other supported options, you may want to prevent the user from configuring some or all of those options as well. Additionally, each driver may have driver-specific options that can affect driver behavior and, therefore, impact your application. Application developers should review all the options supported by a driver to determine which options should be restricted.
For a complete list of supported connection options, refer to the "Connection option descriptions" section of the user's guide for your driver.
Connection options that affect driver libraries
- CryptoLibName
- GSS Client Library (GSSClient)
- OpenSSL Config File (OpenSSLConfigFile)
- OpenSSL Config Path (OpenSSLConfigPath)
- SSLLibName
Connection options that affect driver behavior
- Application Using Threads (ApplicationUsingThreads)
- Catalog Options (CatalogOptions)
- Connection Reset (ConnectionReset)
- Enable Describe Param (EnableDescribeParam)
- Enable FIPS (EnableFIPS)
- Enable Scrollable Cursors (EnableScrollableCursors)
- Enable Static Cursors For Long Data (EnableStaticCursorsForLongData)
- Initialization String (InitializationString)
- PRNGSeedFile
- PRNGSeedSource