Foxpert Software Development & Consulting

Menu

Whitepapers
Downloads
Knowlbits
Guineu

2007-05May-18

Secure error handling

Recently I reviewed a Visual FoxPro application for security issues. This application was using a popular file encryption DLL to transparently encrypt all tables. That's actually a good thing because unencrypted DBF files allow hackers to inject code into a VFP application. Breaking encryption algorithms is a futile exercise for all standard encryption algorithms.

Yet, it was very easy to decrypt all files, because this particular application wasn't protecting the start up process properly. What I did was to rename the encryption DLL. The application failed with an error message, because it couldn't load the DLL. Unfortunately, the error dialog was one of the standard dialogs that offer Cancel and Ignore. After hitting ignore, the next error message was something like "Crypt_Register.PRG not found".

The DLL that defined this function hasn't been loaded. When Visual FoxPro resolves a procedure name, at last it looks for an external PRG file in the current directory. Being equipped with the name of the procedure, I created a small PRG file that merely receives a number of parameters and displays each parameter in a message box. After copying the PRG to the program directory, I launched the application again. Sure enough, one of the parameters was the password.

The lesson to learn from this is that you should never allow the user to continue after an error occurred, unless you can guarantee that the program returns to a safe point. There usually is no such point until you reached READ EVENTS. If an error happens before you got to the READ EVENTS, terminate the application immediately.

Previous KnowlBits

RSS

October 2009 (2)

September 2009 (1)

August 2009 (4)

July 2009 (2)

June 2009 (2)

May 2009 (1)

April 2009 (1)

March 2009 (1)

August 2008 (1)

July 2008 (2)

May 2008 (1)

April 2008 (2)

January 2008 (2)

December 2007 (2)

November 2007 (2)

October 2007 (1)

September 2007 (1)

August 2007 (5)

July 2007 (4)

May 2007 (6)

March 2007 (3)

February 2007 (7)

January 2007 (6)

November 2006 (1)

October 2006 (3)

September 2006 (10)

June 2006 (2)

May 2006 (6)

April 2006 (1)


Impressum Kontakt Contact