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 "Code Correctness: Erroneous finalize() Method"
(→Description) |
|||
Line 1: | Line 1: | ||
{{Template:Vulnerability}} | {{Template:Vulnerability}} | ||
{{Template:Fortify}} | {{Template:Fortify}} | ||
+ | Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' | ||
− | + | [[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]] | |
− | + | [[ASDR Table of Contents]] | |
+ | __TOC__ | ||
==Description== | ==Description== | ||
+ | |||
+ | This finalize() method does not call super.finalize(). | ||
The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().[1] | The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().[1] | ||
<br>The statement above is not completely correct. The Java Language Specification 3.0 section 12.6.1 states: "This should | <br>The statement above is not completely correct. The Java Language Specification 3.0 section 12.6.1 states: "This should | ||
always be done, <b>unless it is the programmer's intent to nullify the actions of the finalizer in the superclass.</b>" | always be done, <b>unless it is the programmer's intent to nullify the actions of the finalizer in the superclass.</b>" | ||
+ | |||
+ | ==Risk Factors== | ||
+ | TBD | ||
==Examples == | ==Examples == | ||
Line 20: | Line 27: | ||
} | } | ||
− | ==Related | + | ==Related [[Attacks]]== |
+ | |||
+ | * [[Attack 1]] | ||
+ | * [[Attack 2]] | ||
+ | |||
+ | |||
+ | ==Related [[Vulnerabilities]]== | ||
+ | |||
+ | * [[Vulnerability 1]] | ||
+ | * [[Vulnerabiltiy 2]] | ||
+ | |||
+ | Note: the contents of "Related Problems" sections should be placed here | ||
+ | |||
+ | |||
+ | ==Related [[Controls]]== | ||
+ | |||
+ | * [[Control 1]] | ||
+ | * [[Control 2]] | ||
+ | |||
+ | Note: contents of "Avoidance and Mitigation" and "Countermeasure" related Sections should be placed here | ||
+ | |||
− | ==Related | + | ==Related [[Technical Impacts]]== |
− | + | * [[Technical Impact 1]] | |
+ | * [[Technical Impact 2]] | ||
− | |||
==References== | ==References== | ||
+ | * [1] J. Gosling, B. Joy, G. Steele, G. Bracha. The Java Language Specification, Second Edition. Addison-Wesley, 2000. | ||
+ | |||
+ | |||
+ | [[Category:FIXME|add links | ||
+ | |||
+ | 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:Java]] | [[Category:Java]] | ||
− | |||
[[Category:Implementation]] | [[Category:Implementation]] | ||
− | |||
[[Category:Code Snippet]] | [[Category:Code Snippet]] | ||
− | |||
[[Category:API Abuse]] | [[Category:API Abuse]] |
Revision as of 11:06, 23 September 2008
This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.
Last revision (mm/dd/yy): 09/23/2008
Vulnerabilities Table of Contents
Description
This finalize() method does not call super.finalize().
The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().[1]
The statement above is not completely correct. The Java Language Specification 3.0 section 12.6.1 states: "This should
always be done, unless it is the programmer's intent to nullify the actions of the finalizer in the superclass."
Risk Factors
TBD
Examples
The following method omits the call to super.finalize().
protected void finalize() { discardNative(); }
Related Attacks
Related Vulnerabilities
Note: the contents of "Related Problems" sections should be placed here
Related Controls
Note: contents of "Avoidance and Mitigation" and "Countermeasure" related Sections should be placed here
Related Technical Impacts
References
- [1] J. Gosling, B. Joy, G. Steele, G. Bracha. The Java Language Specification, Second Edition. Addison-Wesley, 2000.