That is a serious problem, but advocating X11 will not solve anything. Wayland is being improved every day, while X.org is in deep maintenance mode.
And let’s not pretend that X.org is perfect. Race conditions at least can be fixed, even if it takes a lot of time and effort. Worst case, someone will rewrite wlroots in Rust. But in X11 any application can kill other applications, install a key logger, pin itself to the foreground, etcetera. This is by design: it’s what makes window managers, xkill and xeyes work. It’s also a huge security flaw that can never be fixed.