Reachable Assertion

Draft Base
Structure: Simple
Description

A reachable assertion occurs when an attacker can trigger an assert() statement or similar debugging check, causing the application to crash or behave in a more disruptive way than intended. This turns a helpful development tool into a denial-of-service vulnerability.

Extended Description

Assertions are meant to catch logic errors during development, but if left in production code, they can be weaponized. An attacker who discovers the trigger condition can force the application to exit abruptly, disrupting service for all users. For instance, a single triggered assert() in a multi-connection server could terminate every active connection, causing widespread outage. While SAST tools can flag the presence of assertions, managing this risk at scale across a large codebase is challenging. An ASPM platform like Plexicus helps by continuously tracking these flaws in production, and its AI can recommend specific fixes—such as replacing the assert with proper error handling—saving significant manual remediation time.

Common Consequences 1
Scope: Availability

Impact: DoS: Crash, Exit, or Restart

An attacker that can trigger an assert statement can still lead to a denial of service if the relevant code can be triggered by an attacker, and if the scope of the assert() extends beyond the attacker's own session.

Detection Methods 1
Automated Static AnalysisHigh
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Potential Mitigations 2
Phase: Implementation
Make sensitive open/close operation non reachable by directly user-controlled data (e.g. open/close resources)
Phase: Implementation

Strategy: Input Validation

Perform input validation on user data.
Demonstrative Examples 1

ID : DX-183

In the excerpt below, an AssertionError (an unchecked exception) is thrown if the user hasn't entered an email address in an HTML form.

Code Example:

Bad
Java
java
Observed Examples 7
CVE-2023-49286Chain: function in web caching proxy does not correctly check a return value (Incorrect Check of Function Return Value) leading to a reachable assertion (Reachable Assertion)
CVE-2006-6767FTP server allows remote attackers to cause a denial of service (daemon abort) via crafted commands which trigger an assertion failure.
CVE-2006-6811Chat client allows remote attackers to cause a denial of service (crash) via a long message string when connecting to a server, which causes an assertion failure.
CVE-2006-5779Product allows remote attackers to cause a denial of service (daemon crash) via LDAP BIND requests with long authcid names, which triggers an assertion failure.
CVE-2006-4095Product allows remote attackers to cause a denial of service (crash) via certain queries, which cause an assertion failure.
CVE-2006-4574Chain: security monitoring product has an off-by-one error that leads to unexpected length values, triggering an assertion.
CVE-2004-0270Anti-virus product has assert error when line length is non-numeric.
Modes of Introduction
Implementation
Alternate Terms

assertion failure

Taxonomy Mapping
  • The CERT Oracle Secure Coding Standard for Java (2011)
  • Software Fault Patterns