Difference between revisions of "Incorrect block delimitation"

From OWASP
Jump to: navigation, search
Line 40: Line 40:
 
Low
 
Low
  
 +
In many languages, braces are optional for blocks, and - in a case where braces are omitted - it is possible to insert a logic error where a statement is thought to be in a block but is not. This is a common and well known reliability error.
  
==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
 
  
 +
==Risk Factors==
 +
 +
TBD
  
 
==Examples==
 
==Examples==
  
===Short example name===
+
In this example, when the condition is true, the intention may be that both ''x'' and ''y'' run.
: A short example description, small picture, or sample code with [http://www.site.com links]
+
  
===Short example name===
+
<pre>
: A short example description, small picture, or sample code with [http://www.site.com links]
+
if (condition==true) x;
 +
  y;
 +
</pre>
  
  
Line 68: Line 69:
 
* [[Vulnerabiltiy 2]]
 
* [[Vulnerabiltiy 2]]
  
Note: the contents of "Related Problems" sections should be placed here
 
  
  
 
==Related [[Controls]]==
 
==Related [[Controls]]==
  
* [[Control 1]]
+
* Implementation: Always use explicit block delimitation and use static-analysis technologies to enforce this practice.
* [[Control 2]]
+
 
+
Note: contents of "Avoidance and Mitigation" and "Countermeasure" related Sections should be placed here
+
  
  
Line 86: Line 83:
  
 
==References==
 
==References==
Note: A reference to related [http://cwe.mitre.org/ CWE] or [http://capec.mitre.org/ CAPEC] article should be added when exists. Eg:
 
 
* [http://cwe.mitre.org/data/definitions/79.html CWE 79].
 
* http://www.link1.com
 
* [http://www.link2.com Title for the link2]
 
  
 +
TBD
 
[[Category:FIXME|add links
 
[[Category:FIXME|add links
  
Line 122: Line 115:
  
 
[[Category:OWASP ASDR Project]]
 
[[Category:OWASP ASDR Project]]
 
 
==Overview==
 
 
 
==Avoidance and mitigation ==
 
 
Implementation: Always use explicit block delimitation and use static-analysis technologies to enforce this practice.
 
 
==Discussion ==
 
 
In many languages, braces are optional for blocks, and - in a case where braces are omitted - it is possible to insert a logic error where a statement is thought to be in a block but is not. This is a common and well known reliability error.
 
 
==Examples ==
 
 
In this example, when the condition is true, the intention may be that both ''x'' and ''y'' run.
 
 
<pre>
 
if (condition==true) x;
 
  y;
 
</pre>
 
 
==Related problems ==
 
 
Not available.
 
 
 
 
[[Category:Vulnerability]]
 
[[Category:Vulnerability]]
 
[[Category:General Logic Error Vulnerability]]
 
[[Category:General Logic Error Vulnerability]]
 
[[Category:OWASP_CLASP_Project]]
 
[[Category:OWASP_CLASP_Project]]

Revision as of 14:59, 26 September 2008

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

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

Vulnerabilities Table of Contents

ASDR Table of Contents

Contents


Description

In some languages, forgetting to explicitly delimit a block can result in a logic error that can, in turn, have security implications.

Consequences

This is a general logic error - with all the potential consequences that this entails.

Exposure period

  • Implementation

Platform

C, C++, C#, Java

Required resources

Any

Severity

Varies

Likelihood of exploit

Low

In many languages, braces are optional for blocks, and - in a case where braces are omitted - it is possible to insert a logic error where a statement is thought to be in a block but is not. This is a common and well known reliability error.


Risk Factors

TBD

Examples

In this example, when the condition is true, the intention may be that both x and y run.

if (condition==true) x;
  y;


Related Attacks


Related Vulnerabilities


Related Controls

  • Implementation: Always use explicit block delimitation and use static-analysis technologies to enforce this practice.


Related Technical Impacts


References

TBD