All posts by rocco

CWE-1248 – Semiconductor Defects in Hardware Logic with Security-Sensitive Implications

Read Time:11 Second

Description

The security-sensitive hardware module contains semiconductor defects.

Modes of Introduction:

– Manufacturing

 

 

Related Weaknesses

CWE-693

 

Consequences

Availability, Access Control: DoS: Instability

 

Potential Mitigations

Phase: Testing

Description: 

Phase: Operation

Description: 

CVE References

CWE-1249 – Application-Level Admin Tool with Inconsistent View of Underlying Operating System

Read Time:26 Second

Description

The product provides an application for administrators to manage parts of the underlying operating system, but the application does not accurately identify all of the relevant entities or resources that exist in the OS; that is, the application’s model of the OS’s state is inconsistent with the OS’s actual state.

Modes of Introduction:

– Architecture and Design

 

 

Related Weaknesses

CWE-1250

 

Consequences

Access Control: Varies by Context

Accountability: Hide Activities

Other: Unexpected State

 

Potential Mitigations

Phase: Architecture and Design

Description: 

CVE References

CWE-125 – Out-of-bounds Read

Read Time:2 Minute, 9 Second

Description

The software reads data past the end, or before the beginning, of the intended buffer.

Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-119
CWE-119
CWE-119
CWE-119

 

Consequences

Confidentiality: Read Memory

Confidentiality: Bypass Protection Mechanism

By reading out-of-bounds memory, an attacker might be able to get secret values, such as memory addresses, which can be bypass protection mechanisms such as ASLR in order to improve the reliability and likelihood of exploiting a separate weakness to achieve code execution instead of just denial of service.

 

Potential Mitigations

Phase: Implementation

Description: 

Phase: Architecture and Design

Description: 

Use a language that provides appropriate memory abstractions.

CVE References

  • CVE-2014-0160
    • Chain: “Heartbleed” bug receives an inconsistent length parameter (CWE-130) enabling an out-of-bounds read (CWE-126), returning memory that could include private cryptographic keys and other sensitive data.
  • CVE-2018-10887
    • Chain: unexpected sign extension (CWE-194) leads to integer overflow (CWE-190), causing an out-of-bounds read (CWE-125)
  • CVE-2009-2523
    • Chain: product does not handle when an input string is not NULL terminated (CWE-170), leading to buffer over-read (CWE-125) or heap-based buffer overflow (CWE-122).
  • CVE-2018-16069
    • Chain: series of floating-point precision errors
      (CWE-1339) in a web browser rendering engine causes out-of-bounds read
      (CWE-125), giving access to cross-origin data
  • CVE-2004-0183
    • packet with large number of specified elements cause out-of-bounds read.
  • CVE-2004-0221
    • packet with large number of specified elements cause out-of-bounds read.
  • CVE-2004-0184
    • out-of-bounds read, resultant from integer underflow
  • CVE-2008-4113
    • OS kernel trusts userland-supplied length value, allowing reading of sensitive information

CWE-1189 – Improper Isolation of Shared Resources on System-on-a-Chip (SoC)

Read Time:41 Second

Description

The System-On-a-Chip (SoC) does not properly isolate shared resources between trusted and untrusted agents.

Modes of Introduction:

– Architecture and Design

 

 

Related Weaknesses

CWE-653
CWE-668
CWE-1331

 

Consequences

Access Control: Bypass Protection Mechanism

If resources being used by a trusted user are shared with an untrusted user, the untrusted user may be able to modify the functionality of the shared resource of the trusted user.

Integrity: Quality Degradation

The functionality of the shared resource may be intentionally degraded.

 

Potential Mitigations

Phase: Architecture and Design

Description: 

CVE References

  • CVE-2019-6260
    • Baseboard Management Controller (BMC) device implements Advanced High-performance Bus (AHB) bridges that do not require authentication for arbitrary read and write access to the BMC’s physical address space from the host, and possibly the network [REF-1138].

CWE-119 – Improper Restriction of Operations within the Bounds of a Memory Buffer

Read Time:4 Minute, 6 Second

Description

The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.

Modes of Introduction:

– Architecture and Design

 

Likelihood of Exploit: High

 

Related Weaknesses

CWE-118
CWE-20

 

Consequences

Integrity, Confidentiality, Availability: Execute Unauthorized Code or Commands, Modify Memory

If the memory accessible by the attacker can be effectively controlled, it may be possible to execute arbitrary code, as with a standard buffer overflow. If the attacker can overwrite a pointer’s worth of memory (usually 32 or 64 bits), they can redirect a function pointer to their own malicious code. Even when the attacker can only modify a single byte arbitrary code execution can be possible. Sometimes this is because the same problem can be exploited repeatedly to the same effect. Other times it is because the attacker can overwrite security-critical application-specific data — such as a flag indicating whether the user is an administrator.

Availability, Confidentiality: Read Memory, DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)

Out of bounds memory access will very likely result in the corruption of relevant memory, and perhaps instructions, possibly leading to a crash. Other attacks leading to lack of availability are possible, including putting the program into an infinite loop.

Confidentiality: Read Memory

In the case of an out-of-bounds read, the attacker may have access to sensitive information. If the sensitive information contains system details, such as the current buffers position in memory, this knowledge can be used to craft further attacks, possibly with more severe consequences.

 

Potential Mitigations

Phase: Requirements

Description: 

Phase: Architecture and Design

Description: 

This is not a complete solution, since many buffer overflows are not related to strings.

Phase: Build and Compilation

Effectiveness: Defense in Depth

Description: 

This is not necessarily a complete solution, since these mechanisms can only detect certain types of overflows. In addition, an attack could still cause a denial of service, since the typical response is to exit the application.

Phase: Implementation

Description: 

Phase: Operation

Effectiveness: Defense in Depth

Description: 

This is not a complete solution. However, it forces the attacker to guess an unknown value that changes every program execution. In addition, an attack could still cause a denial of service, since the typical response is to exit the application.

Phase: Operation

Effectiveness: Defense in Depth

Description: 

Use a CPU and operating system that offers Data Execution Protection (NX) or its equivalent [REF-60] [REF-61].

This is not a complete solution, since buffer overflows could be used to overwrite nearby variables to modify the software’s state in dangerous ways. In addition, it cannot be used in cases in which self-modifying code is required. Finally, an attack could still cause a denial of service, since the typical response is to exit the application.

Phase: Implementation

Effectiveness: Moderate

Description: 

Replace unbounded copy functions with analogous functions that support length arguments, such as strcpy with strncpy. Create these if they are not available.

This approach is still susceptible to calculation errors, including issues such as off-by-one errors (CWE-193) and incorrectly calculating buffer lengths (CWE-131).

CVE References

  • CVE-2009-2550
    • Classic stack-based buffer overflow in media player using a long entry in a playlist
  • CVE-2009-2403
    • Heap-based buffer overflow in media player using a long entry in a playlist
  • CVE-2009-0689
    • large precision value in a format string triggers overflow
  • CVE-2009-0690
    • negative offset value leads to out-of-bounds read
  • CVE-2009-1532
    • malformed inputs cause accesses of uninitialized or previously-deleted objects, leading to memory corruption
  • CVE-2009-1528
    • chain: lack of synchronization leads to memory corruption
  • CVE-2021-29529
    • Chain: machine-learning product can have a heap-based
      buffer overflow (CWE-122) when some integer-oriented bounds are
      calculated by using ceiling() and floor() on floating point values
      (CWE-1339)
  • CVE-2009-0558
    • attacker-controlled array index leads to code execution
  • CVE-2009-0269
    • chain: -1 value from a function call was intended to indicate an error, but is used as an array index instead.
  • CVE-2009-0566
    • chain: incorrect calculations lead to incorrect pointer dereference and memory corruption
  • CVE-2009-1350
    • product accepts crafted messages that lead to a dereference of an arbitrary pointer
  • CVE-2009-0191
    • chain: malformed input causes dereference of uninitialized memory
  • CVE-2008-4113
    • OS kernel trusts userland-supplied length value, allowing reading of sensitive information
  • CVE-2005-1513
    • Chain: integer overflow in securely-coded mail program leads to buffer overflow. In 2005, this was regarded as unrealistic to exploit, but in 2020, it was rediscovered to be easier to exploit due to evolutions of the technology.
  • CVE-2003-0542
    • buffer overflow involving a regular expression with a large number of captures
  • CVE-2017-1000121
    • chain: unchecked message size metadata allows integer overflow (CWE-190) leading to buffer overflow (CWE-119).

CWE-1190 – DMA Device Enabled Too Early in Boot Phase

Read Time:30 Second

Description

The product enables a Direct Memory Access (DMA) capable device before the security configuration settings are established, which allows an attacker to extract data from or gain privileges on the product.

Modes of Introduction:

– Architecture and Design

 

 

Related Weaknesses

CWE-696

 

Consequences

Access Control: Bypass Protection Mechanism, Modify Memory

DMA devices have direct write access to main memory and
due to time of attack will be able to bypass OS or Bootloader
access control.

 

Potential Mitigations

Phase: Architecture and Design

Description: 

Utilize an IOMMU to orchestrate IO access from
the start of the boot process.

CVE References

CWE-1191 – On-Chip Debug and Test Interface With Improper Access Control

Read Time:46 Second

Description

The chip does not implement or does not correctly perform access control to check whether users are authorized to access internal registers and test modes through the physical debug/test interface.

Modes of Introduction:

– Architecture and Design

 

 

Related Weaknesses

CWE-284

 

Consequences

Confidentiality: Read Application Data

Confidentiality: Read Memory

Authorization: Execute Unauthorized Code or Commands

Integrity: Modify Memory

Integrity: Modify Application Data

Access Control: Bypass Protection Mechanism

 

Potential Mitigations

Phase: Architecture and Design

Effectiveness: High

Description: 

If feasible, the manufacturer should disable the JTAG interface or implement authentication and authorization for the JTAG interface. If authentication logic is added, it should be resistant to timing attacks. Security-sensitive data stored in registers, such as keys, etc. should be cleared when entering debug mode.

CVE References

  • CVE-2019-18827
    • chain: JTAG interface is not disabled (CWE-1191) during ROM code execution, introducing a race condition (CWE-362) to extract encryption keys

CWE-1192 – System-on-Chip (SoC) Using Components without Unique, Immutable Identifiers

Read Time:14 Second

Description

The System-on-Chip (SoC) does not have unique, immutable identifiers for each of its components.

Modes of Introduction:

– Architecture and Design

 

 

Related Weaknesses

CWE-657

 

Consequences

Access Control: Bypass Protection Mechanism

 

Potential Mitigations

Phase: Architecture and Design

Description: 

CVE References

CWE-1193 – Power-On of Untrusted Execution Core Before Enabling Fabric Access Control

Read Time:20 Second

Description

The product enables components that contain untrusted firmware before memory and fabric access controls have been enabled.

Modes of Introduction:

 

 

Related Weaknesses

CWE-696

 

Consequences

Access Control: Bypass Protection Mechanism

An untrusted component can master transactions on the HW bus and target memory or other assets to compromise the SoC boot firmware.

 

Potential Mitigations

Phase: Architecture and Design

Description: 

CVE References