...
Wiki Markup |
---|
The prevalence of null pointer dereferencing bugs is so widespread that it is not uncommon to find errors in security contexts. For instance, Java Webstart applications and applets particular to JDK version 1.6, prior to update 4, were affected by a bug that had some noteworthy security consequences. A {{NullPointerException}} resultedwas generated in some isolated cases when the application or applet attempted to establish an https connection with thea server \[[SDN 08|AA. Java References#SDN 08]\]. This The failure to establish a secure https connection with the server caused a denial of service issue as clients were temporarily left with no choice but forced to provideuse an insecure http channel for data exchange. |
...
Wiki Markup |
---|
This noncompliant example shows a bug in Tomcat version 4.1.24 initially discovered by Reasoning \[[Reasoning 03|AA. Java References#Reasoning 03]\]. The {{cardinality}} method was designed to return the number of occurrences of object {{obj}} in collection {{col}}. A valid use case would beof the {{cardinality}} method is to determine how many objects in the collection are {{null}}. However, givenbecause a {{null}} object parameter. However, when coupledmembership in the collection is checked with the expression {{obj.equals(elt)}} expression, this leads to a guaranteed null pointer dereference is guaranteed whenever {{obj}} is {{null}}. Such ambiguity can also result from the short-circuit behavior of the conditional AND and OR operators (See [EXP06-J. Be aware of the short-circuit behavior of the conditional AND and OR operators]). |
...
Wiki Markup |
---|
Null pointer dereferences can happen in many path dependent ways. Because of the limitations of automatic detection tools, code review and manual inspection of code are indispensable activities \[[Hovemeyer 07|AA. Java References#Hovemeyer 07]\] for the detection of null pointer dereferences. Annotations for method parameters that must be non-null can also alleviate the problem to a certain extent by aiding automatic null pointer dereference detection. |
Risk Assessment
...