r/mysql • u/dirtcreature • 18d ago
solved Latest MySQL Workbench Fields - copy/paste no input sanitization warning
What a waste of 2 hours.
Create SSH tunnel.
Copy/paste usernames and IP addresses from our password storage system.
Cannot connect
Connection Error: Error opening MySQL session through SSH tunnel: Lost connection to MySQL server at 'reading initial communication packet', system error: 0. Workbench.
Check everything on the server three times. What is going on?
Turns out that there is zero input sanitization on the username/ip fields and so Workbench is sending the escaped spaces!
myusername = unername%20
192.168.1.100 = 192.168.1.100%20%20
4
Upvotes
4
u/Aggressive_Ad_5454 18d ago
Yeh. EOL software owned by an outfit that doesn’t really care about it.
HeidiSQL. Or DBeaver.
1
u/ssnoyes 12d ago
Did you file this at https://bugs.mysql.com/ ?
1
u/navicat-gu 5d ago
Painful one. Trailing whitespace from password managers catches a lot of people, and that SSH error message gives you nothing to go on. A few things that save time next time:
ssh -Labove running, create a plain "Standard TCP/IP" connection to127.0.0.1:3307. That skips Workbench's SSH fields completely, and you can keep the tunnel in~/.ssh/configso you never paste hosts again.printf '%q\n' "<paste>"in a terminal, so stray spaces become visible.%20detail, as ssnoyes said. It's a clear, reproducible bug.Disclosure: I'm RC, Director of Digital Strategy @ Navicat. If you end up trying other clients, Navicat 18 has SSH tunnel settings on the connection and a "Test Connection" button that checks the tunnel before you save. Navicat Premium Lite, the free edition, includes SSH/SSL. DBeaver and HeidiSQL, which others mentioned, also do SSH tunnels.