Notes - MCS
Analysis and Exploration of Vulnerabilities
Notes - MCS
Analysis and Exploration of Vulnerabilities
  • Analysis and Exploration of Vulnerabilities
  • Vulnerabilities
    • Vulnerabilities
      • CIA Triad
      • Vulnerability Sources
    • Vulnerability Tracking
    • Vulnerability Disclosure
  • Vulnerability Assessment of Networked Systems
    • Vulnerability Research
    • Vulnerability Assessment
    • Penetration Test
      • Scope
    • Types of Assessments
    • Vulnerability Management Life Cycle
  • Enumeration and Information Leakage
    • Network access
    • Information leakage
    • Errors
    • Web Sources and Support Files
    • Cookies
    • Ports
    • Banners
    • OS Fingerprinting
  • Injection
    • CWE-74
    • How it works
    • Common Pitfalls
    • CWE-89 SQL Injection
    • Using SQL
    • Things to consider
    • The NULL plate
    • SQLi types
    • SQL Injection - Avoiding
    • CWE-78 OS Command Injection
    • Command Override
    • Argument Exploitation
    • GTFOBins and LOLBAS
    • Environmental Variables
    • Parameter Expansion
    • Code Injection - CWE-94
    • Avoiding OS Injection
  • Broken Authentication
    • OWASP A2
    • HTTP Basics
    • HTTP Communication
    • Authentication
    • Authentication Flow State
    • Referer Header
    • SESSION ID
    • Cookies (RFC 6265)
    • JWT - JSON Web Tokens
  • XSS Cross Site Scripting
    • Prevalence and Detectability
    • Reflected XSS
    • Stored XSS
    • DOM XSS
    • Cross Site Request Forgery
    • Avoiding XSS
    • Same Origin Policy
  • Concurrency
    • Concurrency
    • CWE-361 - 7PK - Time and State
    • Basic Time Related CWEs
      • CWE-362 – Race Condition
    • Serializability
    • Database ACID characteristic
    • State Related CWEs
    • Basic Side Effects Related CWEs (Covert Channel)
    • Covert Timing Channel
    • Meltdown Type
  • Buffers
    • Buffer Overflow
    • Popularity decline
    • Potentially Vulnerable Software
    • Dominant prevalence
    • Vulnerabilities in languages (mostly C/C++)
    • Why? Memory Structure 101
    • CWE-120 Classic Overflow
      • Practical Examples
    • Stack Based Vulnerabilities
    • Stack Smashing
    • Countermeasures
    • ROP
Powered by GitBook
On this page
  • Meltdown
  • The problem
  • Basic algorithm
  • Spectre
  • Mitigating Spectre and Meltdown
  1. Concurrency

Meltdown Type

Last updated 1 year ago

Affected systems include most Intel CPUs since 1995.

  • Also some ARM and PowerPC, AMD Phenom, EPYC, ZEN

Meltdown

The problem

  • Out of order execution implies that instructions will be executed before they should.

  • Executing future operations causes side effects to the present.

Basic algorithm

  1. Allocate a 256*4096 chunk of memory.

    1. 256 because the objective is to find the value of a byte, which can have a value from 0 to 256.

    2. Because pages are not accessed, they exist in RAM but not in cache.

    3. There is a timing cover channel present as access cache is faster than accessing RAM.

  2. Create an exception.

  3. Read byte from the target memory (outside the scope of the program).

  4. Multiply byte by 4096.

  5. Use value to access the memory allocated in 1.

Spectre

Similar to Meltdown but exploring different flaws.

  • Meltdown explores an exception, expecting that following instructions are still executed, causing side effects which can be measured.

Spectre explores branch predictors.

  1. Train branch predictor so that CPU predict a positive branch (that is, doesn’t branch).

  2. Execute a condition that will fail.

    1. Code inside that condition will be executed speculatively and result will be discarded

    2. Timing side effects will be present in the cache lines.

  3. Proceed as with meltdown.

Doesn’t generate any exception, can be explore by remote attackers.

  • Javascript in browsers.

  • Network drivers when processing packets.

Mitigating Spectre and Meltdown

For remotely exposed systems (browsers, network), limiting the accuracy of timers is a quick solution.

  • Although the vulnerability exists, data exfiltration will not be possible.

For local systems, microcode and kernel updates are required.

  • Adding barriers to exceptions, preventing speculative execution.

  • Generating bytecode not presenting an attack potential.

Problem... new variants are being presented, exploring an ever increasing surface.