Security as a Fundamental Aspect of Quality

The distinction between the reliability and security aspects of computer systems often boils down to how the systems respectively handle correct and incorrect inputs.

Top 25 Security Issues in Modern Systems

The Common Weakness Enumeration is a joint MITRE/SANS project to identify, classify and document the common security weaknesses of modern computing systems together with recommended best practices to address these weaknesses. Overall the weaknesses are grouped into three broad classes.

Insecure Interaction Between Components

  1. SQL Injection [CWE-89]. This weakness relates to the inclusion of user or external input into the formation of an SQL command.
    Examples.
  2. OS Command Injection [CWE-78]. Like SQL injection, this weakness again relates to insecure use of user or external input, this time in the context of creating an operating system command.
    Examples.
  3. Cross-Site Scripting [CWE-79]. User or external input to scripts on one site may generate web pages that can compromise another site.
    Examples.
  4. Unrestricted File Upload [CWE-434].
    Examples.
  5. Cross-Site Request Forgery [CWE-352].
    Examples.
  6. Open Redirect [CWE-601].
    Examples.

Unsafe Resource Management

  1. Buffer Overflow [CWE-120]. If the size of input strings is not checked before copying, data may be copied beyond reserved buffer areas.
    Examples.
  2. Path Traversal [CWE-22]. User or external paths with "../" sequences may allow access to restricted directories.
    Examples.
  3. Code Download [CWE-494].
    Examples.
  4. Untrusted Code [CWE-829].
    Examples.
  5. Unsafe Library Functions [CWE-676].
    Examples.
  6. Incorrect Buffer Size Calculation [CWE-131].
    Examples.
  7. Uncontrolled Format String [CWE-134].
    Examples.
  8. Integer Overflow or Wraparound [CWE-190].
    Examples.

Compromised Defenses

  1. Missing Authentication for Critical Function [CWE-306].
    Examples.
  2. Missing Authorization [CWE-862].
    Examples.
  3. Use of Hard-coded Credentials [CWE-798].
    Examples.
  4. Missing Encryption of Sensitive Data [CWE-311].
    Examples.
  5. Reliance on Untrusted Inputs in a Security Decision [CWE-807].
    Examples.
  6. Execution with Unnecessary Privileges [CWE-250].
    Examples.
  7. Incorrect Authorization [CWE-863].
    Examples.
  8. Incorrect Permission Assignment for Critical Resource [CWE-732].
    Examples.
  9. Use of a Broken or Risky Cryptographic Algorithm [CWE-327].
    Examples.
  10. Improper Restriction of Excessive Authentication Attempts [CWE-307].
    Examples.
  11. Use of a One-Way Hash without a Salt [CWE-759].
    Examples.

Security Practices

Mitigating the Top 25 Weaknesses

To address the security weaknesses represented by its top 25 list, the CWE site also offers a list of its top 9 mitigations, the monster mitigations.

Default Deny

Whitelists instead of blacklists

Secure Coding Practices

The Software Engineering Institute at Carnegie Mellon University has a series of secure coding standards that address specific known problems in particular programming languages as well as general security recommendations.

Language-Based Secure Coding Standards

Language-Independent Coding Practices

The CERT Top 10 Secure Coding Practices represent best language-independent practices for building security into software systems by design.