05. Secure Coding Principles

OWASP Top 10 (Class)

  1. Broken Access Control:
  1. Cryptographic failure:
  1. Injection attack:
  1. Insecure Design
  1. Security Misconfiguration:
  1. Vulnerable Components
  1. Authentication Failure
  1. Security Logging/Monitoring Failures
  1. Server-side request forgery

Unsafe Constructs

See OWASP Secure Coding Practices

TOCTOU Race

When there is a time lapse between time-of-check to time-of-use:

Overflow Issues (Mostly C/C++)

This may cause the system may crash or read garbage data. However, an attacker may be able to exploit this.

Weak type safety: C will silently convert integers by keeping the least significant bits. After overflow of a signed integer, the value will be the maximum negative number.

Pointer arithmetic:

Buffer overflow and NOP slide:

Coding practices: