Security Holes – Part 2
In Part-1 of this post we spoke about security holes and 2 sources of vulnerabilities: Buffer Overflow and SQL Injection. We will cover next 3 sources in this post. Integer Overflow Integer overflow is the result of an attempt by a CPU to arithmetically generate a number larger than what can fit in the devoted memory storage space. The most common result in these cases is for the least significant representable bits of the result to be stored (the result is said to wrap). Causes Poor validation of arithmetic operations Lack of awareness of casting order and implicit casts from operators Failing to enforce the assumptions made Redemption Choose your datatypes carefully Do not rely on implicit typecasts Enforce your assumptions by using proper validations and appropriate variable datatypes Error Handling Error handling refers to the anticipation, finding, and resolve of programming errors. An example is the lack of sufficient memory to run an application or a m...