Home > Buffer Overruns: Extra defensive measures
Book Excerpt:
EMAIL THIS

Buffer Overruns: Extra defensive measures

19 Sep 2005 | McGraw-Hill

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   

The 19 Deadly Sins of Software Security The following excerpt is from Chapter 1 of "The 19 Deadly Sins of Software Security" written by Michael Howard, David LeBlanc and John Viega. Click for the complete book excerpt series or visit McGraw-Hill to purchase the book.

Extra defensive measures

Consider additional defensive measures the same way you think of seat belts in your car. Seat belts will often reduce the severity of a crash, but you still do not want to get into an accident. It's important to note that for every major class of buffer overrun mitigation, previously exploitable conditions that are no longer exploitable at all exist; and for any given mitigation technique, a sufficiently complex attack can overcome the technique completely. Let's look at a few of them.

Stack protection

Stack protection was pioneered by Crispin Cowan in his Stackguard product, and was independently implemented by Microsoft as the /GS compiler switch. At its most basic, stack protection places a value known as a canary on the stack between the local variables and the return address. Newer implementations may also re-order variables for increased effectiveness. The advantage of this approach is that it is cheap, has minimal performance overhead, and has the additional benefit of making debugging stack corruption bugs easier. Another example is ProPolice, a Gnu Compiler Collection (GCC) extension created by IBM. Any current product should utilize stack protection.

You should be aware that stack protection can be overcome by a variety of techniques. If a virtual function pointer table is overwritten and the function is called prior to return from the function -- virtual destructors are good candidates -- then the exploit will occur before stack protection can come into play.

Non-executable stack and heap

This countermeasure offers considerable protection against an attacker, but it can have a significant application compatibility impact. Some applications legitimately compile and execute code on the fly, such as many applications written in Java and C#. It's also important to note that if the attacker can cause your application to fall prey to a return into libc attack, where a legitimate function call is made to accomplish nefarious ends, then the execute protection on the memory page may be removed.

Unfortunately, most of the hardware currently available is unable to support this option, and support varies with CPU-type, operating system, and operating system version as well. As a result, you cannot count on this protection being present in the field, but you must test with it enabled to ensure that your application is compatible with a non-executable stack and heap, by running your application on hardware that supports hardware protection, and the target operating system set to use the protection. For example, if you are targeting Windows XP, then make sure you run all your tests on a Windows XP SP2 computer using an AMD Athlon 64 FX processor. On Windows, this technology is called Data Execution Protection (DEP); it was once known as No eXecute (NX).

Windows Server 2003 SP1 also supports this capability. PaX for Linux and OpenBSD also support non-executable memory.

Click for the next excerpt in this series: Other resources


Click for the book excerpt series or visit McGraw-Hill to purchase the book.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Microsoft Office Suite
Should you switch to the Office 2007 file format?
Microsoft Office 2010: At a glance
Microsoft Office 2010 ready for testing
New Enterprise Desktop e-zine
Microsoft wraps Office SP2 with better doc support
Combining folder redirection with roaming profiles
Microsoft releases infrastructure updates for server products
Microsoft Office Project Server 2007: New features and some that have been retired
What's hot in Windows security? New Microsoft Office Security Guide
Free HTML editor makes intranet updates a breeze

Microsoft Internet Explorer (IE)
Admins can wear many hats using Netcat
Patching third-party browsers adds more work in Windows shops
Four Internet Explorer 8 Group Policy security settings
Safe enterprise Web browsing: Five tips in five minutes
Top client security tips of 2006
General security configuration: Step 1
Protection against international domain names, URL handling: Step 3
ActiveX opt-ins, information bar and cross-domain protection: Step 4
Windows Vista and IE7: Step 5
Phishing filter: Step 2

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
system tray  (SearchEnterpriseDesktop.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary




Windows Admin Solutions - User Management, Application Management, Windows Deployments
HomeTopicsITKnowledge ExchangeTipsMultimediaWhite PapersBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2008 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts