Given that some of the small USB chargers that are posing as Apple ones exist (usually cost reduced by removing the hash filters!), this might be a real problem. The biggest problem is that the space for the "nasty" part is quite small. That being said, it could be reduced down to a single chip if its only function were to install a file on the "host".
Lots of $$$ needed for this, but some people (governments) had such resources! Possibly even the US government you never know (file detects Arabic script and goes further...).
Look, it may have already been done, and we just don't know about it!