ZDNet UK


Skip to Main Content

  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Jobs
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


Office applications Toolkit

Stop intruders exploiting applications

Robert L. Bogue Builder.com

Published: 09 Feb 2004 10:45 GMT

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

Designing for application security is one thing; keeping someone out of your application is important; however, allowing someone to take control of a system through your application can be substantially worse. Designing your applications to prevent a system-level security breach is significantly different from preventing security vulnerabilities at the application level. In application security, you're looking for things that are entirely in your control. In designing applications for system security, you're trying to prevent security vulnerabilities from occurring in your own code as well as the code that your code uses.

Buffer overflows
The major cause of security breaches in application code these days is buffer overflows. A buffer overflow is simply where the code allocates only a small amount of memory space for the parameters it is provided and then the function receives more data than it was expecting. Occasionally, this opens the capability for someone to run malicious code because the end of the buffer overwrites some of the application's code and, when the application goes to run its code, it accidentally runs what was at the end of the parameter that was provided.

Most people working in languages today take a relatively carefree attitude to buffer overflows. Working in Visual Basic, Visual Basic.Net, C#, Java, or one of a dozen other languages means that you don't have to worry about buffer overflows internally in your applications. Either the language itself or the underlying infrastructure automatically manages the amount of buffer space allocated for strings and other parameters. Because of this, for all practical purposes, it's impossible to overflow a buffer within the confines of an application.

The challenge comes in when you utilise an API, a COM object, or some other component that was not designed in a language that automatically manages memory allocation and buffers for you. Most of the APIs available in Windows, including the core Windows APIs, were written in C or C++. Neither of these languages have automatic management for buffers. This leaves the possibility open that you could pass in a parameter that exceeds the internal buffer and allows the execution of someone else's code.

Obviously, some consideration must be given to parameter lengths when calling outside "safe" languages. If you're taking input in directly from a user or external system and passing it along to an API, check the length of the parameter for the API. This will prevent your "safe" language from passing through an unsafe request. A few quick "sanity" checks for parameters can prevent real problems.

Next

Previous

1 2 3


  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

Did you find this article useful?
200 out of 452 people found this useful


Full Talkback thread

0 comments

Featured Talkback

In association with Intel
Why do so many (virtually all) software packages think that they are so important that they have to be started automatically every time the computer boots? What is the largest number of "speed access", "update check", "camera download" and whatever other background programs you have ever seen running? Of those, how many did you really need?

By: J.A. Watson

Read full story:
Annoying software: a rogues' gallery

Discussions

PeterJudge PeterJudge

Want to buy a nuclear bunker?

Thursday 4 December 2008, 9:53 PM

2 comments
Moley Moley

Adoption of Chrome

Thursday 4 December 2008, 8:39 PM

2 comments
PeterJudge PeterJudge

Want to buy a nuclear bunker?

Thursday 4 December 2008, 2:56 PM

2 comments

Vista Upgrade Blog

OS Scratch Load Times

I reload the operating systems on my laptops quite frequently. On the Linux side, it is because I am trying various distributions, while on the Windows side it is more often because... More

3 comments

Wireless Networking - Linksys WRT350N...

Ok, this is driving me crazy. Why does this not work? I have a Linksys WRT350N Wireless-N router, and a laptop with an Intel 4965AGN Wireless Network Interface. When I am running... More

5 comments

Software Jihad part 2

I guess the point of my previous post (read rant if you want) was that Microsoft makes a lot of noise of "protecting" their IP but in reality they are only paying lip-service to it... More

3 comments