I am seeing this behaviour in a suite of lab computers. Students hit the space bar to either power up the computer or bring the monitor out of sleep. In the latter case that keypress propagates to the username field in lightdm-gtk-greeter, so an invalid username is processed when they try to login.
Stripping whitespace in the username field, or otherwise checking for IEEE 1003.1-2001 compliance would fix this.