it's worse with web stuff though... and it's a real vector.
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=terminal+es...
https://packetstormsecurity.com/files/162518/AWS-CloudShell-...
Is it really common to run terminals as root? I can't remember the last time I did. Sure, I open a terminal as my user, and then run 'sudo bash' to get a shell as root, but the terminal is still running as my user. Were you meaning something else?
Which, incidentally, is the most pleasurable way of experiencing UNIX and UNIX-likes. (Shellboxen)
Also one common way to install "DevOps" stuff piping scripts from curl (and them being asked for root)
This is the kind of vulnerability the GP was talking about here I think https://nvd.nist.gov/vuln/detail/CVE-2021-27135 and there have been a few in the history of terminals. If you've looked at the code for the historical terms (xterm, rxvt etc) it's very large and kinda gnarly. If you're security or performance-conscious there are probably better choices nowdays (eg Alacritty which I primarily use) which have a much smaller attack surface.
I could imagine an attack like this:
printf 'rm -rf /\n\033[%iAecho "Hello World!"\n'
When executed in a terminal this looks like it generates an innocent shell script. But when piped into a file and the executed it will delete all your files.
This is a really ridiculous assumption.
similarly to shells and base/foundational software (like logging libraries).
Bash itself goes for long spans of time without updates in their release versions https://git.savannah.gnu.org/cgit/bash.git