Difference between revisions of "Addition of data-structure sentinel"

From OWASP
Jump to: navigation, search
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{Template:Vulnerability}}
 
{{Template:Vulnerability}}
 
{{Template:SecureSoftware}}
 
{{Template:SecureSoftware}}
 
+
<br>
 
+
[[ASDR Table of Contents]]
+
  
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
 +
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
  
 
==Description==
 
==Description==
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
 
 
The accidental addition of a data-structure sentinel can cause serious programming logic problems.
 
The accidental addition of a data-structure sentinel can cause serious programming logic problems.
  
Line 44: Line 42:
 
Data-structure sentinels are often used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list.
 
Data-structure sentinels are often used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list.
  
It is, of course dangerous, to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification outside of some wrapper interface which provides safety.
+
It is, of course, dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification outside of some wrapper interface which provides safety.
  
 
By adding a sentinel, one potentially could cause data to be truncated early.
 
By adding a sentinel, one potentially could cause data to be truncated early.
 
 
  
 
==Risk Factors==
 
==Risk Factors==
Line 91: Line 87:
  
 
* Operational: Use OS-level preventative functionality. Not a complete solution.
 
* Operational: Use OS-level preventative functionality. Not a complete solution.
 
  
  
Line 101: Line 96:
 
==References==
 
==References==
 
TBD
 
TBD
[[Category:FIXME|need 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__
 
__NOTOC__
Line 133: Line 102:
 
[[Category:Vulnerability]]
 
[[Category:Vulnerability]]
 
[[Category:General Logic Error Vulnerability]]
 
[[Category:General Logic Error Vulnerability]]
 +
[[Category: Logging and Auditing Vulnerability]]
 
[[Category:OWASP_CLASP_Project]]
 
[[Category:OWASP_CLASP_Project]]
 
[[Category:Code Snippet]]
 
[[Category:Code Snippet]]
 
[[Category:C]]
 
[[Category:C]]
 
[[Category:OWASP ASDR Project]]
 
[[Category:OWASP ASDR Project]]

Latest revision as of 19:10, 20 February 2009

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



Last revision (mm/dd/yy): 02/20/2009

Vulnerabilities Table of Contents

Description

The accidental addition of a data-structure sentinel can cause serious programming logic problems.

Consequences

  • Availability: Generally this error will cause the data structure to not work properly by truncating the data.

Exposure period

  • Requirements specification: The choice could be made to use a language that is not susceptible to these issues.
  • Design: Mitigating technologies such as safe string libraries and container abstractions could be introduced.
  • Implementation: Many logic errors can lead to this condition. It can be exacerbated by lack of or misuse of mitigating technologies.

Platform

  • Languages: C, C++, Fortran, Assembly
  • Operating platforms: All, although partial preventative measures may be deployed depending on environment.

Required resources

Any

Severity

Very High

Likelihood of exploit

High to Very High

Data-structure sentinels are often used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list.

It is, of course, dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification outside of some wrapper interface which provides safety.

By adding a sentinel, one potentially could cause data to be truncated early.

Risk Factors

TBD

Examples

In C/C++:

char *foo;
foo=malloc(sizeof(char)*4);
foo[0]='a';
foo[1]='a';
foo[2]=0;
foo[3]='c';
printf("%c %c %c %c %c \n",foo[0],foo[1],foo[2],foo[3]);
printf("%s\n",foo);

Related Attacks

TBD


Related Vulnerabilities

TBD


Related Controls

TBD

  • Pre-design: Use a language or compiler that performs automatic bounds checking.
  • Design: Use an abstraction library to abstract away risky APIs. Not a complete solution.
  • Pre-design through Build: Compiler-based canary mechanisms such as StackGuard, ProPolice, and Microsoft Visual Studio / GS flag. Unless this provides automatic bounds checking, it is not a complete solution.
  • Operational: Use OS-level preventative functionality. Not a complete solution.


Related Technical Impacts

References

TBD