This vulnerability occurs when a single function is registered to handle multiple different operating system signals, creating potential race conditions if that function isn't carefully designed.
When the same function handles multiple signals, an attacker can exploit timing issues by sending a second signal while the handler is still processing the first. If the handler uses shared resources like global variables or non-reentrant functions, this interruption can corrupt program state, potentially leading to crashes, denial of service, or even code execution. Even without classic race conditions, this pattern creates risk. Attackers can trigger the handler multiple times by sending different signals sequentially, causing unintended side effects. This is especially dangerous for handlers designed to run only once, as forced re-execution can bypass security controls or destabilize the application.
Impact: DoS: Crash, Exit, or RestartExecute Unauthorized Code or CommandsRead Application DataGain Privileges or Assume IdentityBypass Protection MechanismVaries by Context
The most common consequence will be a corruption of the state of the product, possibly leading to a crash or exit. However, if the signal handler is operating on state variables for security relevant libraries or protection mechanisms, the consequences can be far more severe, including protection mechanism bypass, privilege escalation, or information exposure.
cc
/* artificially increase the size of the timing window to make demonstration of this weakness easier. /
c
c