CWE-617: Reachable Assertion (Base)

Description: The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.

Extended Description: While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.


Alternate Terms: ::TERM:assertion failure::


Modes of Introduction: ::PHASE:Implementation::



Common Consequences: ::SCOPE:Availability:IMPACT:DoS: Crash, Exit, or Restart:NOTE: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: ::METHOD:Automated Static Analysis:DESCRIPTION: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.):EFFECTIVENESS:High::

Potential Mitigations: ::PHASE:Implementation:DESCRIPTION:Make sensitive open/close operation non reachable by directly user-controlled data (e.g. open/close resources)::PHASE:Implementation:STRATEGY:Input Validation:DESCRIPTION:Perform input validation on user data.::

Observed Examples: ::REFERENCE:CVE-2023-49286:DESCRIPTION:Chain: function in web caching proxy does not correctly check a return value (CWE-253) leading to a reachable assertion (CWE-617):LINK:https://www.cve.org/CVERecord?id=CVE-2023-49286::REFERENCE:CVE-2006-6767:DESCRIPTION:FTP server allows remote attackers to cause a denial of service (daemon abort) via crafted commands which trigger an assertion failure.:LINK:https://www.cve.org/CVERecord?id=CVE-2006-6767::REFERENCE:CVE-2006-6811:DESCRIPTION:Chat 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.:LINK:https://www.cve.org/CVERecord?id=CVE-2006-6811::REFERENCE:CVE-2006-5779:DESCRIPTION:Product allows remote attackers to cause a denial of service (daemon crash) via LDAP BIND requests with long authcid names, which triggers an assertion failure.:LINK:https://www.cve.org/CVERecord?id=CVE-2006-5779::REFERENCE:CVE-2006-4095:DESCRIPTION:Product allows remote attackers to cause a denial of service (crash) via certain queries, which cause an assertion failure.:LINK:https://www.cve.org/CVERecord?id=CVE-2006-4095::REFERENCE:CVE-2006-4574:DESCRIPTION:Chain: security monitoring product has an off-by-one error that leads to unexpected length values, triggering an assertion.:LINK:https://www.cve.org/CVERecord?id=CVE-2006-4574::REFERENCE:CVE-2004-0270:DESCRIPTION:Anti-virus product has assert error when line length is non-numeric.:LINK:https://www.cve.org/CVERecord?id=CVE-2004-0270::