NetSPI Imformation Security Consulting
NetSPI Blog

POSTS BY DAN GARDNER

Do Not Use the Back Door!

| Friday, November 6th, 2009

In system development a backdoor creates a way of bypassing normal authentication to allow access to a system. Secret backdoor credentials often exist deep in the thousands or millions of lines of code that make up a system. This is just one reason why building your own user management/authorization/authentication schemes into systems is a bad idea, but that is a topic for another time.

I was recently on an elevator with some people who apparently worked for a software company. I overheard something about how their support people use a backdoor in order to access the application. I thought that the practice of installing backdoors in applications was well known to be a very bad idea, and that the practice went the way of the NeXT machine. Perhaps I was wrong.

This bit of overheard conversation opens a Pandoras box of questions: Which applications have backdoors? Should my software vendor be required to tell me if the application has a backdoor? How many applications are out there that we dont know about with backdoors that were created by developers, either well intentioned or malicious?

Imagine if a popular home finance package, for example, had a backdoor. Even if it had been put there with the best of intentions, all it would take is one malicious individual with knowledge of the backdoor to destroy not only the software vendor but also the personal finances of millions of individuals.

NetSPIs application code review assessments include checking for backdoors. Given the small amount of application code that ever gets reviewed, let alone by a third-party security assessment like NetSPI’s, it is safe to assume that there are a lot of scary things buried in trillions of lines of source code out there.

My advice:

Developers: Dont implement backdoors. It is a very bad practice.

QA & Development managers: Include checks for backdoors in your SDLC.

Consumers: Ask your application vendors if there are any backdoors in their products, and get their answers in writing.

Permalink | Email the Author | No Comments

Preventing SQL Injection at the Database

| Friday, October 16th, 2009

SQL injection vulnerabilities are common out in the real world. We spend a lot of time and effort looking for SQL injection vulnerabilities in application code, a good and necessary practice. Application security, however, must be considered at every layer of the system. In fact, by using a good database and data access layer design, we can help eliminate the possibility of a SQL injection vulnerability.

True, the topic of database and data access layer design is expansive, including the use of service accounts and row-level authorization. But for now, here’s a simple way using two small requirements to make sure that the database itself is doing its part to facilitate a secure database and data access layer and to protect against SQL injection attacks.

These two requirements are:

1) All data access should occur via parameterized stored procedures.

2) Users should be limited to CONNECT and EXECUTE privileges.

By ensuring that all data access is via stored procedures, we can enforce the practice of parameterizing variables, thus eliminating the possibility of random SQL statements getting to our database. Of course, you must also make sure that your stored procedures are properly written and do not include any insecure practices such as using sp_executesql.

By limiting users to CONNECT and EXECUTE privileges, we can limit the possibility of users executing random SQL statements. If they try to SELECT anything, for example, it will fail.

Permalink | Email the Author | No Comments