Telnet is "sandboxed" in that it can only output characters to your tty, however that in itself is quite a powerful primitive.
The ANSI control characters wield power of a huge stack of not very robust code
https://nvd.nist.gov/vuln/detail/CVE-2024-56803