Difference between revisions of "Overflow of static internal buffer"

From OWASP
Jump to: navigation, search
 
(Examples)
Line 47: Line 47:
 
In C++:
 
In C++:
  
 +
<pre>
 
public int password r = 45;
 
public int password r = 45;
 +
</pre>
 +
 
In Java:
 
In Java:
  
 +
<pre>
 
static public String r;
 
static public String r;
 +
</pre>
 +
 
This is a uninitiated static class which can be accessed without a get-accessor and changed without a set-accessor.
 
This is a uninitiated static class which can be accessed without a get-accessor and changed without a set-accessor.
  

Revision as of 12:31, 16 April 2006



Overview

A non-final static field can be viewed and edited in dangerous ways.

Consequences

  • Integrity: The object could potentially be tampered with.
  • Confidentiality: The object could potentially allow the object to be read.

Exposure period

  • Design through Implementation: This is a simple logical issue which can be easily remedied through simple protections.

Platform

  • Languages: Java, C++
  • Operating platforms: Any

Required resources

Any

Severity

Medium

Likelihood of exploit

High

Avoidance and mitigation

  • Design through Implementation: Make any static fields private and final.

Discussion

Non-final fields, which are not public can be read and written to by arbitrary Java code.

Examples

In C++:

public int password r = 45;

In Java:

static public String r;

This is a uninitiated static class which can be accessed without a get-accessor and changed without a set-accessor.

Related problems

Not available.

Categories