CWE-12 – ASP.NET Misconfiguration: Missing Custom Error Page

Read Time:50 Second

Description

An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework’s built-in responses.

The mode attribute of the tag defines whether custom or default error pages are used.

Modes of Introduction:

– Implementation

 

 

Related Weaknesses

CWE-756

 

Consequences

Confidentiality: Read Application Data

Default error pages gives detailed information about the error that occurred, and should not be used in production environments. Attackers can leverage the additional information provided by a default error page to mount attacks targeted on the framework, database, or other resources used by the application.

 

Potential Mitigations

Phase: System Configuration

Description: 

Handle exceptions appropriately in source code. ASP .NET applications should be configured to use custom error pages instead of the framework default page.

Phase: Architecture and Design

Description: 

Do not attempt to process an error or attempt to mask it.

Phase: Implementation

Description: 

Verify return values are correct and do not supply sensitive information about the system.

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

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-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-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-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-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-118 – Incorrect Access of Indexable Resource (‘Range Error’)

Read Time:15 Second

Description

The software does not restrict or incorrectly restricts operations within the boundaries of a resource that is accessed using an index or pointer, such as memory or files.

Modes of Introduction:

– Architecture and Design

 

 

Related Weaknesses

CWE-664

 

Consequences

Other: Varies by Context

 

Potential Mitigations

CVE References

News, Advisories and much more

Exit mobile version