47

If an application crashes, the program stops and there is nothing anyone can do about it, other than starting the program again.

Crash is a bad behaviour in general and should be avoided, but why are they seen as security vulnerability?

Manoj R
  • 533
  • 4
  • 8

7 Answers7

56
  1. It crashed because some input was not processed correctly. An attacker may try to find the code path that leads to the faulty procedure and attempt to execute arbitrary code through potential vulnerabilities.

  2. Crashes may give an attacker valuable information about the system and its internal details.

  3. Crashes may create temporary vulnerabilities or leave unprotected files (e.g. memory dumps) that may be exploited.

  4. (Thanks and a hat tip go to Ladadadada) The application that crashes needs to be restarted, which obviously takes time (even with watchdogs and symmetric failover schemes). If an attacker replicates the conditions leading to the crash your service will suffer from prolonged outage (Denial-of-service) which means financial, reputation, and other losses.

Deer Hunter
  • 5,297
  • 5
  • 33
  • 50
  • 8
    [CWE-20](http://cwe.mitre.org/data/definitions/20.html), [CWE-209](http://cwe.mitre.org/data/definitions/209.html), [CWE-528](http://cwe.mitre.org/data/definitions/528.html) & [CWE-534](http://cwe.mitre.org/data/definitions/534.html), [CWE-400](http://cwe.mitre.org/data/definitions/400.html) (and probably a few more), and regular guest on the [OWASP top 10](https://www.owasp.org/index.php/Top_10_2007-Information_Leakage_and_Improper_Error_Handling) – mr.spuratic Apr 02 '13 at 09:42
14

As previous answer have covered most of the scenario in which attacker can get direct benefit by analyzing application crashes. I will recommend read on "Analyze Crashes to Find Security Vulnerabilities in Your Apps". Analyzing crashes for security vulnerabilities may require low level programming skills. As shown in figure 1 every exploit may not lead to security vulnerability and defines a investigation path for analyzing application crashes.

  • enter image description here
Ali Ahmad
  • 4,784
  • 8
  • 35
  • 61
11

To generalise Deer Hunter's answer:

  • If an application crashes, it means that what is happening is not expected, and not understood.
  • If it is not expected and not understood, you have no way of knowing whether it is safe.
  • You must therefore assume that it is not safe.

Note that simply catching and discarding an unexpected exception is also insecure and not to be done. Terminating the process is better than continuing in an unexpected inconsistent state.

This is essentially the distillate of Feynman's Appendix:

(...) erosion and blow-by are not what the design expected. They are warnings that something is wrong. The equipment is not operating as expected, and therefore there is a danger that it can operate with even wider deviations in this unexpected and not thoroughly understood way. The fact that this danger did not lead to a catastrophe before is no guarantee that it will not the next time, unless it is completely understood.

You can find the full document here:

This is recommended reading for all software developers, particularly those who have the habit of catching exceptions which they do not fully understand.

Ben
  • 3,697
  • 1
  • 18
  • 24
3

An application crash is the result of an unexpected and unhandled behaviour. This means there is a bug in the application that crashed, and numerous bugs leads to vulnerabilities.

One of the most dangerous kind of crash is ths crash due to memory corruption (Segmentation fault). This kind of bugs can often be exploited to make the vulnerable application execute an arbitrary (malicius) piece of code.

Moreover a way to crash a software can be used in denial of service attacks.

PiotrC
  • 31
  • 1
2

You are merging two different events: stopping and crashing

  • If an application really stops cleanly it can no longer do any harm
  • If an application crashes it can show all kinds of undefined and unexpected behavior as show in other answers. 'Stopping' is only one outcome. It may also start using 100% of the CPU indefinitely, leading to all kinds of other problems.
Jeff
  • 3,599
  • 4
  • 17
  • 23
2

Certain types of crashes are known as "Access Violations" these are the Crashes/Anomaly which "violates" the rule defined by programmers who wrote system/software/operating-system or defined by programmers who wrote compilers which makes executables.

Suppose attacker(Neo) finds a crash into one of the software(Matrix) he can use that crash to "violate" the rule(rules witch are defined for Matrix) and he can use that crash to take control over system(Matrix) and now He want to do malicious activity(Turn off the matrix) for that he knows a API call ,but that API call is controlled/guarded by another program/antivirus(Agent Smith), but since he got the full control over system(matrix) he can close Antivirus(Agent Smith) and now he can close the system(Matrix)

Since this will affect confidentiality, integrity, and availability of the system these crashes are called as Security Issues.

  • An exploit doesn't always lead to total system control, as not all programs run with uid 0. But once you've got a shell on the system, you can use it for other harmful things. – ott-- Sep 22 '13 at 19:26
1

Many application crashes -not all of them, but many- involve the machine executing something that it shouldn't have. The machine jumps into something that it thinks is supposed to be code, but it's actually zeroed-out or random data (or at least data that hasn't been prepared as code). The machine tries to look at this data as code, but it doesn't make any sense as code, so the machine doesn't know what to do. When that happens, the application crashes.

But the thing about bugs is that if you know how to trigger them, you can trigger them deliberately. Sometimes, depending on how the bug works, you can even control what data the machine jumps into. That possibility is what makes security folks nervous: if you can make the machine jump into data that doesn't make any sense, and you can control what that data is, then you could make the machine jump into something that does make sense. Once you've got that set up, you could make the machine do more or less whatever you want.

Not every application crash works this way. @AliAhmad's answer shows the basics of how to tell what can and what can't. But because the consequences of an unsafe crash can be so severe, every crash has to be checked out to see if it's "safe" or not.

The Spooniest
  • 1,637
  • 9
  • 10