Security engineers have a name for it now: the Just-In-Time Privilege Elevation Linux Terminal Bug. It is a flaw in certain privilege escalation workflows where elevated rights are granted for a limited command window, but timing or session state leaks let the privilege persist beyond its intended boundary. On busy systems or with the wrong terminal emulators, that window can stretch. Attackers can exploit the race to execute arbitrary commands as root without leaving the usual sudo logs.
The bug surfaces in setups that implement just-in-time access controls at the shell level instead of enforcing them deeper in the OS. If the terminal fails to revoke the elevated shell context at exactly the right time, the process tree may retain root privileges in child shells. This is not an abstract edge case. It has been reproduced in hardened environments where privilege boundaries are supposed to reset every few minutes.
Fixing it requires more than patching the terminal. Session teardown must happen in the PAM stack or privilege broker, not at the UI layer. Environment variables, tty sessions, and inherited file descriptors must all be cleaned. Logging should verify that every elevation event is paired with a definitive drop.