Description
Asterisk is an open source private branch exchange and telephony toolkit. Prior to versions 20.15.2, 21.10.2, and 22.5.2, if a SIP request is received with an Authorization header that contains a realm that wasn't in a previous 401 response's WWW-Authenticate header, or an Authorization header with an incorrect realm was received without a previous 401 response being sent, the get_authorization_header() function in res_pjsip_authenticator_digest will return a NULL. This wasn't being checked before attempting to get the digest algorithm from the header which causes a SEGV. This issue has been patched in versions 20.15.2, 21.10.2, and 22.5.2. There are no workarounds.
Vulnerability type
CWE-253
Incorrect Check of Function Return Value
The product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions.
Impact on systems
| Scope | Impact |
| Availability, Integrity |
Unexpected State, DoS: Crash, Exit, or Restart An unexpected return value could place the system in a state that could lead to a crash or other unintended behaviors. |
How to prevent it
Architecture and Design · Language Selection
Use a language or compiler that uses exceptions and requires the catching of those exceptions.
Implementation
Properly check all functions which return a value.
Implementation
When designing any function make sure you return a value or throw an exception in case of an error.
All 17 CWE-253 CVEs, with trend and prevention