Question: Explain non malicious program errors with the help of examples.
0

Mumbai University > Information Technology > Sem6 > System and Web Security

Marks: 10M

Year: Dec 2015

ADD COMMENTlink
modified 3.0 years ago  • written 3.0 years ago by gravatar for Ramnath Ramnath3.7k
2

Being human, programmers and other developers make many mistakes, most of which are unintentional and nonmalicious. Many such errors cause program malfunctions but do not lead to more serious security vulnerabilities.

However, a few classes of errors have plagued programmers and security professionals for decades, and there is no reason to believe they will disappear.

  • Covert Channel:
  1. A covert channel is a type of computer security attack that creates a capability to transfer information objects between processes that are not supposed to be allowed to communicate by the computer security policy.

  2. A covert channel is so called because it is hidden from the access control mechanisms of ultra-high-assurance secure operating systems since it does not use the legitimate data transfer mechanisms of the computer system such as read and write, and therefore cannot be detected or controlled by the hardware based security mechanisms that underlie ultra-high-assurance secure operating systems.

  3. Covert channels are exceedingly hard to install in real systems, and can often be detected by monitoring system performance; in addition, they suffer from a low signal-to-noise ratio and low data rates (on the order of a few bits per second).

  4. They can also be removed manually with a high degree of assurance from secure systems by well established covert channel analysis strategies.

  • Buffer overflow:
  1. A buffer overflow is the computing equivalent of trying to pour two liters of water into a one-liter pitcher: Some water is going to spill out and make a mess. And in computing, what a mess these errors have made!

  2. Example:

    i.

    char sample[10] or char sample[i]

        for (i= 0; i<=9; i++)
    
        sample[i] = ‘A’;
    
        sample[10] = ‘B’;
    

enter image description here

  • Incomplete Mediation:

    i. Incomplete mediation means incomplete checking.

    ii. Mediation implements access control that specifies who can access what.

    iii. Incomplete mediation is easy to exploit and attackers use it to cause security problems.

    iv. For example consider following URL:

    https://www.somesite.com/subpage/userinput&parm1=(808)555- 1212&parm2=2004Jan01 The two parameters look like a telephone number and a date. Probably the client's (user's) web browser enters those two values in their specified format for easy processing on the server's side.

    v. What would happen if parm2 were submitted as 1800Jan01? Or 1800Feb30? Or 2048Min32? Or 1Aardvark2Many? Something would likely fail.

    vi. As with buffer overflows, one possibility is that the system would fail catastrophically, with a routine's failing on a data type error as it tried to handle a month named "Min" or even a year (like 1800) which was out of range.

    vii. Another possibility is that the receiving program would continue to execute but would generate a very wrong result. Then again, the processing server might have a default condition, deciding to treat 1Aardvark2Many as 3 July 1947. The possibilities are endless.

    viii. One way to address the potential problems is to try to anticipate them. For instance, the programmer in the examples above may have written code to check for correctness on the client's side (that is, the user's browser). The client program can search for and screen out errors. Or, to prevent the use of nonsense data, the program can restrict choices only to valid ones.

    ix. For example, the program supplying the parameters might have solicited them by using a drop-down box or choice list from which only the twelve conventional months would have been possible choices.

  • Time-of-Check to Time-of-Use Errors:

    i. The fourth programming flaw we investigate involves synchronization. To improve efficiency, modern processors and operating systems usually change the order in which instructions and procedures are executed.

    ii. In particular, instructions that appear to be adjacent may not actually be executed immediately after each other, either because of intentionally changed order or because of the effects of other processes in concurrent execution.

    iii. Every requested access must be governed by an access policy stating who is allowed access to what; then the request must be mediated by an access policy enforcement agent. But an incomplete mediation problem occurs when access is not checked universally.

    iv. The time-of-check to time-of-use (TOCTTOU) flaw concerns mediation that is performed with a "bait and switch" in the middle. It is also known as a serialization or synchronization flaw.

    v. To understand the nature of this flaw, consider a person's buying a sculpture that costs \$100. The buyer removes five \$20 bills from a wallet, carefully counts them in front of the seller, and lays them on the table.

    vi. Then the seller turns around to write a receipt. While the seller's back is turned, the buyer takes back one \$20 bill. When the seller turns around, the buyer hands over the stack of bills, takes the receipt, and leaves with the sculpture.

    vii. Between the time when the security was checked (counting the bills) and the access (exchanging the sculpture for the bills), a condition changed: what was checked is no longer valid when the object (that is, the sculpture) is accessed.

    viii. A similar situation can occur with computing systems. Suppose a request to access a file were presented as a data structure, with the name of the file and the mode of access presented in the structure. An example of such a structure is shown in

enter image description here

ix. The data structure is essentially a "work ticket," requiring a stamp of authorization; once authorized, it will be put on a queue of things to be done. Normally the access control mediator receives the data structure, determines whether the access should be allowed, and either rejects the access and stops or allows the access and forwards the data structure to the file handler for processing.

x. It is at this point that the incomplete mediation flaw can be exploited. While the mediator is checking access rights for the file my_file, the user could change the file name descriptor to your_file, the value shown in Figure 3.

enter image description here

xi. The problem is called a time-of-check to time-of-use flaw because it exploits the delay between the two times. That is, between the time the access was checked and the time the result of the check was used, a change occurred, invalidating the result of the check.

ADD COMMENTlink
modified 3.0 years ago  • written 3.0 years ago by gravatar for Ramnath Ramnath3.7k
Please log in to add an answer.