These exploits usually target the PC side. If anything this makes it harder to target iPhones, since you have harder time at making sure your malicious cable would be used on an iPhone, while with USB-Lightning you are sure of it.
If exploits were universal to all platforms than your remark would make sense.
A user should have the expectation that charging a device does not compromise the safety.