Difference between revisions of "State synchronization error"

From OWASP
Jump to: navigation, search
Line 2: Line 2:
 
{{Template:SecureSoftware}}
 
{{Template:SecureSoftware}}
  
==Overview==
+
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
  
State synchronization refers to a set of flaws involving contradictory states of execution in a process which result in undefined behavior.
+
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
==Consequences ==
+
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
  
* Undefined: Depending on the nature of the state of corruption, any of the listed consequences may result.
+
[[ASDR Table of Contents]]
 +
__TOC__
  
==Exposure period ==
 
  
* Design: Design flaws may be to blame for out-of-sync states, but this is the rarest method.
+
==Description==
  
* Implementation: Most likely, state-synchronization errors occur due to logical flaws and race conditions introduced at implementation time.
+
State synchronization refers to a set of flaws involving contradictory states of execution in a process which result in undefined behavior.
  
* Run time: Hardware, operating system, or interaction with other programs may lead to this error.
+
'''Consequences'''
  
==Platform ==
+
* Undefined: Depending on the nature of the state of corruption, any of the listed consequences may result.
  
* Languages: All
+
'''Exposure period'''
  
* Operating platforms: All
+
* Design: Design flaws may be to blame for out-of-sync states, but this is the rarest method.
 +
* Implementation: Most likely, state-synchronization errors occur due to logical flaws and race conditions introduced at implementation time.
 +
* Run time: Hardware, operating system, or interaction with other programs may lead to this error.
 +
 
 +
'''Platform'''
 +
 
 +
* Languages: All
 +
* Operating platforms: All
  
 
==Required resources ==
 
==Required resources ==
Line 35: Line 42:
  
 
Medium to High
 
Medium to High
 +
 +
 +
 +
==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==
 +
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]
 +
 +
[[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]]
 +
 +
 +
==Overview==
 +
  
 
==Avoidance and mitigation ==
 
==Avoidance and mitigation ==

Revision as of 15:08, 30 September 2008

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

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

Vulnerabilities Table of Contents

ASDR Table of Contents

Contents


Description

State synchronization refers to a set of flaws involving contradictory states of execution in a process which result in undefined behavior.

Consequences

  • Undefined: Depending on the nature of the state of corruption, any of the listed consequences may result.

Exposure period

  • Design: Design flaws may be to blame for out-of-sync states, but this is the rarest method.
  • Implementation: Most likely, state-synchronization errors occur due to logical flaws and race conditions introduced at implementation time.
  • Run time: Hardware, operating system, or interaction with other programs may lead to this error.

Platform

  • Languages: All
  • Operating platforms: All

Required resources

Any

Severity

High

Likelihood of exploit

Medium to High


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

Note: A reference to related CWE or CAPEC article should be added when exists. Eg:


Overview

Avoidance and mitigation

  • Implementation: Pay attention to asynchronous actions in processes; and make copious use of sanity checks in systems that may be subject to synchronization errors.

Discussion

The class of synchronization errors is large and varied, but all rely on the same essential flaw. The state of the system is not what the process expects it to be at a given time.

Obviously, the range of possible symptoms is enormous, as is the range of possible solutions. The flaws presented in this section are some of the most difficult to diagnose and fix. It is more important to know how to characterize specific flaws than to gain information about them.

Examples

In C/C++:

static void print(char * string) {
  char * word;
  int counter;
  fflush(stdout);
  for(word = string; counter = *word++; ) putc(counter, stdout);
}

int main(void) {
   pid_t pid;
   if( (pid = fork()) < 0) exit(-2);
   else if( pid == 0) print("child");
   else print("parent\n");
   exit(0);
}

In Java:

class read{
  private int lcount;
  private int rcount;
  private int wcount;

  public void getRead(){
    while ((lcount == -1) || (wcount !=0));
    lcount++;

  public void getWrite(){
    while ((lcount == -0);
    lcount--;
    lcount=-1;

  public void killLocks(){
    if (lcount==0) return;
    else if (lcount == -1) lcount++;
    else lcount--;
  }
}

Related problems

Not available.