Security Vulnerabilities Decomposition Katy Anton OWASP Top 10 - - PowerPoint PPT Presentation

security vulnerabilities decomposition
SMART_READER_LITE
LIVE PREVIEW

Security Vulnerabilities Decomposition Katy Anton OWASP Top 10 - - PowerPoint PPT Presentation

Security Vulnerabilities Decomposition Katy Anton OWASP Top 10 @KatyAnton When the report is published @KatyAnton Katy Anton Software development background Project co-leader for OWASP Top 10 Proactive Controls (@OWASPControls)


slide-1
SLIDE 1

Security Vulnerabilities Decomposition

Katy Anton

slide-2
SLIDE 2

@KatyAnton

OWASP Top 10

slide-3
SLIDE 3

@KatyAnton

When the report is published

slide-4
SLIDE 4

@KatyAnton

  • Software development background
  • Project co-leader for

OWASP Top 10 Proactive Controls (@OWASPControls)

  • Principle Application Security Consultant

Katy Anton

slide-5
SLIDE 5

@KatyAnton

A formal list for of software security weaknesses in:

  • architecture
  • design
  • code

Source: https://cwe.mitre.org/

Common Weakness Enumeration

slide-6
SLIDE 6

@KatyAnton

Source: https://nvd.nist.gov/vuln/categories/cwe-layout

NVD: CWE Categories

slide-7
SLIDE 7

@KatyAnton

Injection Category

slide-8
SLIDE 8

@KatyAnton

CWEs in Injection Category

  • CWE-93: CRLF Injection

CWE-74 Injection

CWE-943: Improper Neutr. of Special El in Query

CWE-94: Code Injection CWE-91: XML Injection CWE-78: XSS CWE-77: Commmand Injection

CWE-89: SQL Injection CWE-90:LDAP Injection Source: NVD CWE-78: OS Cmd Inj CWE-78: Argument Inj

slide-9
SLIDE 9

@KatyAnton

slide-10
SLIDE 10

@KatyAnton

Is there another way to look at it?

slide-11
SLIDE 11

@KatyAnton

Decompose the Injection

Get / Post Data File Uploads HTTP Headers Database Data Config files SQL HTML XML Bash Script LDAP Query SQL Parser HTML Parser XML Parser Shell LDAP Parser Input Output Parser

Data interpreted as Code

slide-12
SLIDE 12

@KatyAnton

Extract Security Controls

Input Output Parser Vulnerability Encode Output Parameterize Validate Input XSS

R R

SQL Injection

R R

XML Injection

R R

Code Injection

R R

LDAP Injection

R R

Cmd Injection

R R

Primary Controls

Defence in depth

slide-13
SLIDE 13

@KatyAnton

(or lack of Intrusion Detection)

Intrusions

slide-14
SLIDE 14

@KatyAnton

If a pen tester is able to get into a system without being detected, then there is insufficient logging and monitoring in place

slide-15
SLIDE 15

@KatyAnton

The security control developers can use to log security information during the runtime operation of an application.

Security Controls: Security Logging

slide-16
SLIDE 16

@KatyAnton

Good attack identifiers:

  • 1. Authorisation failures
  • 2. Authentication failures
  • 3. Client-side input validation bypass
  • 4. Whitelist input validation failures
  • 5. Obvious code injection attack
  • 6. High rate of function use

The 6 Best Types of Detection Points

slide-17
SLIDE 17

@KatyAnton

Request Exceptions

  • Application receives GET when expecting POST
  • Additional form /URL parameters

Examples of Intrusion Detection Points

slide-18
SLIDE 18

@KatyAnton

Authentication Exceptions

  • Additional variables received during an authentication

like ‘admin=true’’

  • Providing only one of the credentials

The user submits POST request which only contains the username variable. The password was removed.

Examples of Intrusion Detection Points

slide-19
SLIDE 19

@KatyAnton

Input Exceptions

  • Input validation failure on server despite client side

validation

  • Input validation failure on server side on non-user

editable parameters

  • e.q:hidden fields, checkboxes, radio buttons, etc

S

Examples of Intrusion Detection Points

slide-20
SLIDE 20

@KatyAnton

Secure Data Handling: Basic Workflow

Application Server Operating System Software Application Param Queries Encode output

Validate Data

Log Exceptions

slide-21
SLIDE 21

@KatyAnton

Data at Rest and in Transit

Sensitive Date Exposure

slide-22
SLIDE 22

@KatyAnton

Data

Data Types Encryption Hashing

Data at Rest: Requires initial value E.q: credit card

R

Data at Rest: Doesn’t require initial value E.q: user passwords

R

Data in Transit

R

slide-23
SLIDE 23

@KatyAnton

How Not to Do it !

Data at Rest: Design Vulnerability example

encryption_key = PBKF2(psswd, salt, iterations, key_length);

In the same folder - 2 file: The content of password.txt:

slide-24
SLIDE 24

@KatyAnton

Strong Encryption Algorithm: AES Key Management

  • Store unencrypted keys away from the encrypted data.
  • Protect keys in a Key Vault (Hashicorp Vault / Amazon KMS)
  • Keep away from home grown key management solutions.
  • Define a key lifecycle.
  • Build support for changing algorithms and keys when needed
  • Document procedures for managing keys through the lifecycle

Source: https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html

Encryption: Security Controls

slide-25
SLIDE 25

@KatyAnton

  • Data in Transit: Security Controls

Application Server Operating System Software Application

TLS TLS TLS TLS

slide-26
SLIDE 26

@KatyAnton

Using Software Components with Known Vulnerabilities

Third Party Components

slide-27
SLIDE 27

@KatyAnton

Apps with at least 1 vulnerable component:

  • 85.7% of .Net applications
  • 92% of C++ applications

State of Software Security

Source: https://www.veracode.com/state-of-software-security-report

slide-28
SLIDE 28

@KatyAnton

  • Difficult to understand
  • Easy to break
  • Difficult to test
  • Difficult to upgrade
  • Increase technical debt

Root Cause

slide-29
SLIDE 29

@KatyAnton

Sum of the total different points through which a malicious actor can try to enter data into or extract data from an environment.

What is Attack Surface?

slide-30
SLIDE 30

@KatyAnton

Minimize the attack surface area

Fundamental Security Principle

slide-31
SLIDE 31

@KatyAnton

Example of external components:

  • Open source libraries - for example: a logging library
  • APIs - for example: vendor APIs
  • Packages by another team within same company

Components Examples

slide-32
SLIDE 32

@KatyAnton

  • Third-party - provides logging levels:
  • FATAL, ERROR, WARN, INFO, DEBUG.
  • We need only:
  • DEBUG, WARN, INFO.

Example 1: Implement Logging Library

slide-33
SLIDE 33

@KatyAnton

Helps to:

  • Expose only the functionality

required.

  • Hide unwanted behaviour.
  • Reduce the attack surface area.
  • Update or replace libraries.
  • Reduce the technical debt.

Simple Wrapper

Module Module Interface Module Module Module Third-Party Library Module Module

slide-34
SLIDE 34

@KatyAnton

Scenario:

  • Vendor APIs - like payment gateways
  • Can have more than payment gateway one in

application

  • Require to be inter-changed

Example 2: Implement a Payment Gateway

slide-35
SLIDE 35

@KatyAnton

  • Converts from provided interface

to the required interface.

  • A single Adapter interface can

work with many Adaptees.

  • Easy to maintain.

Adapter Design Pattern

Your Code

Third-party code

Adapter

slide-36
SLIDE 36

@KatyAnton

  • Libraries / packages created by another team within

same company

  • Re-used by multiple applications
  • Common practice in large companies

Example 3: Implement a Single Sign-On

slide-37
SLIDE 37

@KatyAnton

  • Simplifies the interaction

with a complex sub-system

  • Make easier to use a poorly

designed API

  • It can hide away the details

from the client.

  • Reduces dependencies on

the outside code.

Façade Design Pattern

slide-38
SLIDE 38

Secure Software Starts from Design !

Adapter Pattern To convert from the required interface to provided interface Your Code

Third-party code

Adapter Wrapper To expose only required functionality and hide unwanted behaviour.

Module Module Interface Module Module Module Third-Party Library Module Module

Façade Pattern To simplify the interaction with a complex sub-system.

Module Module Facade Module Module Module Complex sub-system Module Module

slide-39
SLIDE 39

@KatyAnton

How often ?

slide-40
SLIDE 40

@KatyAnton

  • United States Army office of British origin
  • Born in Hayle, Cornwall, UK
  • Director of Security for Morgan Stanley at

WTC

Rick Rescorla

slide-41
SLIDE 41

@KatyAnton

Security Controls Recap

slide-42
SLIDE 42

@KatyAnton

Security Controls In Development Cycle

Application Server Operating System Software Application Param Queries Encode

  • utput

TLS Validate Input TLS TLS Mo Mo Encap Mo Mo Mo Librar Mo Mo

Encapsulation

OS Command Logs Log Exception Param Data Secure Date

Key Management

slide-43
SLIDE 43

@KatyAnton

Verify Early and Often

Final Takeaways

CWEs

CWEs

Focus on Security Controls

which prevent

slide-44
SLIDE 44

@KatyAnton

  • OWASP Top 10 Proactive Controls

https://owasp.org/www-project-proactive-controls/

  • OWASP Cheat Series

https://cheatsheetseries.owasp.org/

References

slide-45
SLIDE 45

@KatyAnton

@KatyAnton

Thank you very much