We strongly encourage you to use the following security precautions to minimize the chance of unauthorized access to your ProductCart Control Panel and store database. It is especially important that confidential information such as FTP credentials and ProductCart Control Panel credentials are (1) regularly changed; (2) always changed after being shared with ANY third party.
Make sure to carefully review the section dedicated to PCI compliance and specifically the important ProductCart PA-DSS Implementation Guide.
<%
Response.Buffer = True
If (Request.ServerVariables("HTTPS") = "off") Then
Dim xredir__, xqstr__
xredir__ = "https://" & Request.ServerVariables("SERVER_NAME") & _
Request.ServerVariables("SCRIPT_NAME")
xqstr__ = Request.ServerVariables("QUERY_STRING")
if xqstr__ <> "" Then xredir__ = xredir__ & "?" & xqstr__
Response.redirect xredir__
End if
%>
MS Access databases are inherently less secure because an Access database, unlike a MS SQL database, can be downloaded just like any other file if their location is known. Therefore, you should take the following precautions to ensure the location of your store database cannot be easily guessed.
Password-protect the store database
You can password-protect the Microsoft® Access database that powers your online store. To do so, first download the database to your local machine. Then, launch Access and select File/Open. Locate the file that you just downloaded and open it using the Open Exclusive option. You can select the Open Exclusive option from the Open drop-down located in the bottom right corner of the Open File window (Access 2002). Once the database is open select Tools/Security/Set Database Password. Enter a password, confirm it and click OK.
Upload the database back to your Web server. The database will now require a password before being opened or accessed by any application. This is true for ProductCart too. Therefore, you will need to modify the DSN or DSN-less connection to include the password information. You may easily do so by editing a filed called storeconstants.asp located in the productcart/includes folder.
For example, if you are using a DSN connection “DSN=productcart” becomes “DSN=productcart;PWD=yourPassword”
If you are using a DSN-less connection:
“DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\yourdatabase.mdb”
becomes…
“DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb;PWD=password”
If you are particularly concerned about the possibility of SQL injection against your database, you can run the following two queries to reduce permissions on two system tables for the database user that is used in the ProductCart database connection string (UID located in the connection string saved to the file ”includes/storeconstants.asp”). This measure could prevent the execution of certain types of SQL injection attacks, however it is not seen as a necessity since the ASP source code already contains methods to sanitize data entered by users.
These queries can be run successfully as long as the database user that is employed in the ProductCart database connection string has permissions to create and drop tables.
The change in permissions consists in denying SELECT permissions for the ProductCart database user to the sysobjects and syscolumns tables in the MS SQL database. This measure specifically protects a database from SQL injection attacks such as the one performed in the spring of 2008, which relied on these system tables to be able to identify other, existing table names and crawl through the entire database injecting their fields with malicious code.
The commands to run in query analyzer are:
deny select on sysobjects to DatabaseUser deny select on syscolumns to DatabaseUser
… where DatabaseUser corresponds to the UID value in the database connection string in your storeconstants.asp file.
If you are setting up a new ProductCart store, run these queries after setting up the ProductCart database.
If you receive an error similar to the following:
Msg 4604, Level 16, State 1, Line 1 There is no such user or group 'YOURUSER'.
This is probably due to the fact that the user “YOURUSER” belongs to the default database role called “Public”.
You can get around the problem by running the same queries with “Public” instead of the user name used in the connection string. Therefore, the queries become.
deny select on sysobjects to Public deny select on syscolumns to Public
Can this have any adverse affects? Not within ProductCart. However, if there are other applications that are using the same database and the same database user, and need access those two tables, then this will affect those applications and not allow them to run properly. If this is the case, setup a different user that is used solely for ProductCart and run the queries above for that user only.
In addition, you will not be able to view any of the tables through Enterprise Manager or SQL Management Studio (since those functions require the use of the sysobjects and syscolumns tables). It does not affect the use of the Query Analyzer, since it does not need to dynamically retrieve information from the system tables in order to run straight queries.
Finally, if you need to reverse these commands, you can execute the following queries:
Grant select on sysobjects to DatabaseUser Grant select on syscolumns to DatabaseUser
If any vulnerability is found in ProductCart: