|
|||||||||||
|
Re: safestr alpha (Safe C String Library)
From: John Viega <viega(at)securesoftware.com>
Date: Tue Feb 11 2003 - 14:15:20 EST
It's not practical in the slightest to attempt to validate that the programmer is checking the condition. The easiest thing to do along those lines is to check if the programmer explicitly announces he checked it, which you can't do until the next time the program calls into your API, at which point it may very well be too late. In the current library, we do tend to exit the program any time there's the chance of a security issue, more as a placeholder than anything. But, many of those exits from the program can and will go away. For example, consider the case of double freeing a string. This can potentially be a security problem with standard strings. With our library, we detect that you're trying to free a safestr object that has already been freed, so we can just return an error, but instead we exit. We *could* just return from the free with an error code, which is fine. However, for the time being, we don't, and I don't feel bad about it, because if you've got a double-free error, you really should fix your problem! In general, as long as the library can defuse the problem (which is almost always the case), then you can take the following approach:
The problem is that the API needs to remain simple for people to use it. So having to add parameters for passing back an error code is likely not to be acceptable, particularly for frequently used calls. John On Tuesday, February 11, 2003, at 01:37 PM, Dana Epp wrote: > Instead of simply dieing... is it possible to validate that the
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:46 EDT |
||||||||||
|
|||||||||||