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 "Unrestricted Critical Resource Lock"

From OWASP
Jump to: navigation, search
m (Reverted edits by LetorElmon (Talk) to last version by KirstenS)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Stub}}
+
{{template:CandidateForDeletion}}
'''Example 1:''' The following Java method never closes the file handle it opens. The finalize() method for FileInputStream eventually calls close(), but there is no guarantee as to how long it will take before the finalize() method will be invoked. In a busy environment, this can result in the JVM using up all of its file handles.
 
  
<pre>
 
private void processFile(String fName) throws FileNotFoundException, IOException
 
{
 
  FileInputStream fis = new FileInputStream(fName);
 
  int sz;
 
  byte[] byteArray = new byte[BLOCK_SIZE];
 
  while ((sz = fis.read(byteArray)) != -1) {
 
processBytes(byteArray, sz);
 
  }
 
}
 
</pre>
 
  
'''Example 2:''' Under normal conditions the following C# code executes a database query, processes the results returned by the database, and closes the allocated SqlConnection object. But if an exception occurs while executing the SQL or processing the results, the SqlConnection object is not closed. If this happens often enough, the database will run out of available cursors and not be able to execute any more SQL queries.
+
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
<pre>
 
...
 
SqlConnection conn = new SqlConnection(connString);
 
SqlCommand cmd = new SqlCommand(queryString);
 
cmd.Connection = conn;
 
conn.Open();
 
SqlDataReader rdr = cmd.ExecuteReader();
 
HarvestResults(rdr);
 
conn.Connection.Close();
 
...
 
</pre>
 
  
'''Example 3:''' The following C function does not close the file handle it opens if an error occurs. If the process is long-lived, the process can run out of file handles.
+
#REDIRECT [[::Category:Vulnerability]]
  
<pre>
 
int decodeFile(char* fName)
 
{
 
char buf[BUF_SZ];
 
FILE* f = fopen(fName, "r");
 
 
if (!f) {
 
printf("cannot open %s\n", fName);
 
return DECODE_FAIL;
 
} else {
 
while (fgets(buf, BUF_SZ, f)) {
 
if (!checkChecksum(buf)) {
 
  return DECODE_FAIL;
 
} else {
 
  decodeBlock(buf);
 
}
 
}
 
}
 
fclose(f);
 
return DECODE_SUCCESS;
 
}
 
</pre>
 
  
 +
==Description==
  
[[Category:Synchronization and Timing Vulnerability]]
+
A vulnerability is a weakness in an application (frequently a broken or missing control) that enables an attack to succeed. Be sure you don't put [attacks] or [controls] in this category.
 +
 
 +
# Start with a one-sentence description of the vulnerability
 +
# What is the problem that creates the vulnerability?
 +
# What are the attacks that target this vulnerability?
 +
# What are the technical impacts of this vulnerability?
 +
 
 +
 
 +
==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==
 +
 
 +
===Short example name===
 +
: A short example description, small picture, or sample code with [http://www.site.com links]
 +
 
 +
===Short example name===
 +
: A short example description, small picture, or sample code with [http://www.site.com links]
 +
 
 +
 
 +
==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]]
 +
 
 +
 
 +
==References==
 +
 
 +
TBD

Latest revision as of 19:57, 26 May 2009

Template:CandidateForDeletion


Last revision (mm/dd/yy): 05/26/2009


#REDIRECT :Category:Vulnerability


Description

A vulnerability is a weakness in an application (frequently a broken or missing control) that enables an attack to succeed. Be sure you don't put [attacks] or [controls] in this category.

  1. Start with a one-sentence description of the vulnerability
  2. What is the problem that creates the vulnerability?
  3. What are the attacks that target this vulnerability?
  4. What are the technical impacts of this vulnerability?


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

Short example name

A short example description, small picture, or sample code with links

Short example name

A short example description, small picture, or sample code with links


Related Attacks


Related Vulnerabilities


Related Controls


Related Technical Impacts


References

TBD