This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Dead Code: Unused Field"

From OWASP
Jump to: navigation, search
 
Line 2: Line 2:
 
{{Template:Fortify}}
 
{{Template:Fortify}}
  
==Abstract==
+
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
 +
 
 +
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
 +
 
 +
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
 +
 
 +
[[ASDR Table of Contents]]
 +
__TOC__
  
This field is never used.
 
  
 
==Description==
 
==Description==
Line 10: Line 16:
 
This field is never accessed, except perhaps by dead code. It is likely that the field is simply vestigial, but it is also possible that the unused field points out a bug.
 
This field is never accessed, except perhaps by dead code. It is likely that the field is simply vestigial, but it is also possible that the unused field points out a bug.
  
==Examples ==
 
  
'''Example 1:'''
+
==Risk Factors==
 +
 
 +
* Talk about the [[OWASP Risk Rating Methodology|factors]] that make this vulnerability likely or unlikely to actually happen
 +
* Discuss the technical impact of a successful exploit of this vulnerability
 +
* Consider the likely [business impacts] of a successful attack
 +
 
 +
 
 +
==Examples==
 +
 
 +
===Example 1===
  
 
The field named glue is not used in the following class. The author of the class has accidentally put quotes around the field name, transforming it into a string constant.
 
The field named glue is not used in the following class. The author of the class has accidentally put quotes around the field name, transforming it into a string constant.
Line 28: Line 42:
 
</pre>
 
</pre>
  
'''Example 2:'''
+
===Example 2===
  
 
The field named glue is used in the following class, but only from a method that is never called.
 
The field named glue is used in the following class, but only from a method that is never called.
Line 44: Line 58:
 
</pre>
 
</pre>
  
==Related Threats==
 
  
==Related Attacks==
+
==Related [[Attacks]]==
 +
 
 +
* [[Attack 1]]
 +
* [[Attack 2]]
 +
 
 +
 
 +
==Related [[Vulnerabilities]]==
 +
 
 +
* [[Vulnerability 1]]
 +
* [[Vulnerabiltiy 2]]
 +
 
 +
 
 +
==Related [[Controls]]==
 +
 
 +
* [[Control 1]]
 +
* [[Control 2]]
 +
 
 +
 
 +
==Related [[Technical Impacts]]==
 +
 
 +
* [[Technical Impact 1]]
 +
* [[Technical Impact 2]]
 +
 
  
==Related Vulnerabilities==
+
==References==
 +
TBD
  
==Related Countermeasures==
+
[[Category:FIXME|add links
  
==Categories==
+
In addition, one should classify vulnerability based on the following subcategories: Ex:<nowiki>[[Category:Error Handling Vulnerability]]</nowiki>
  
 +
Availability Vulnerability
 +
 +
Authorization Vulnerability
 +
 +
Authentication Vulnerability
 +
 +
Concurrency Vulnerability
 +
 +
Configuration Vulnerability
 +
 +
Cryptographic Vulnerability
 +
 +
Encoding Vulnerability
 +
 +
Error Handling Vulnerability
 +
 +
Input Validation Vulnerability
 +
 +
Logging and Auditing Vulnerability
 +
 +
Session Management Vulnerability]]
 +
 +
__NOTOC__
 +
 +
 +
[[Category:OWASP ASDR Project]]
 
[[Category:Code Quality Vulnerability]]
 
[[Category:Code Quality Vulnerability]]
 
 
[[Category:Java]]
 
[[Category:Java]]
 
 
[[Category:Implementation]]
 
[[Category:Implementation]]
 
 
[[Category:Code Snippet]]
 
[[Category:Code Snippet]]

Revision as of 22:18, 23 September 2008

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.

This article includes content generously donated to OWASP by MicroFocus Logo.png

Last revision (mm/dd/yy): 09/23/2008

Vulnerabilities Table of Contents

ASDR Table of Contents


Description

This field is never accessed, except perhaps by dead code. It is likely that the field is simply vestigial, but it is also possible that the unused field points out a bug.


Risk Factors

  • Talk about the factors that make this vulnerability likely or unlikely to actually happen
  • Discuss the technical impact of a successful exploit of this vulnerability
  • Consider the likely [business impacts] of a successful attack


Examples

Example 1

The field named glue is not used in the following class. The author of the class has accidentally put quotes around the field name, transforming it into a string constant.

	public class Dead {
	
	  String glue;
	
	  public String getGlue() {
		return "glue";
	  }
	
	}

Example 2

The field named glue is used in the following class, but only from a method that is never called.

	public class Dead {
	
	  String glue;
	
	  private String getGlue() {
		return glue;
	  }
	
	}


Related Attacks


Related Vulnerabilities


Related Controls


Related Technical Impacts


References

TBD