Search:     Advanced search
server monitoring

Null Dereference

Article ID: 115
Last updated: 06 May, 2008
Views: 427
Posted: 06 May, 2008
by: Tech Pubs S.
Updated: 06 May, 2008
by: Tech Pubs S.

Null Dereference

Abstract

The program can potentially dereference a null pointer, thereby raising a NullPointerException.

Description

Null pointer errors are usually the result of one or more programmer assumptions being violated.

Most null pointer issues result in general software reliability problems, but if an attacker can intentionally trigger a null pointer dereference, the attacker might be able to use the resulting exception to bypass security logic or to cause the application to reveal debugging information that will be valuable in planning subsequent attacks.

Examples

In the following code, the programmer assumes that the system always has a property named "cmd" defined. If an attacker can control the program's environment so that "cmd" is not defined, the program throws a null pointer exception when it attempts to call the trim() method.

String cmd = System.getProperty("cmd"); cmd = cmd.trim();

This article was:   Helpful | Not Helpful
Prev   Next
Poor Logging Practice: Logger Not Declared Static Final     Memory Leak