Try to enable the input, then disable the whole chatbox by a script.
The input will disappear. You won't be able to open Console. Once the chatbox gets enabled again, every key you pressed still got into the input.
Got this problem on servers with login panel and big download.
Joining a server, waiting for download, pressing T to get the cursor, after download is finished the chatbox gets usually disabled. If I write my password to the login panel now, it will later be shown in the chatbox input.