I've asked the question Power-only USB connection to charge my phone - as simple as cutting the data lines? in electronics SE. In order to bypass the "Why do you want to do this?" request for clarification, I explained. Here is the first paragraph:
In a pinch I bought a $3 "phone recharger" from the bin shown below, but now I am too scared to connect it directly to my phone, which costs orders of magnitude more. While a poor design could present undesirable qualities to the 5V power output, I have no idea if there's something inside connected to the data lines - part of the 21st century USB angst that has many people saying "not in my USB port you don't". See this security SE answer for some background on USB angst.
I was repeatedly scolded in comments for wanting to be careful, e.g.
And what are you afraid of from the charger? What's it going to do? Tell your wife you've been looking at porn sites?
However there was some clarification:
You've also misunderstood the linked question on Security SE. Those plug in to a USB host and do nasty things to them by pretending to be a diffetent type if device. Your charger is the host in this case, and so can't present itself as any other device to your phone. It could (maybe) implement a host and install drivers (on itself) for the USB devices your phone presents, but it would have to be setup for a particular type of phone.
I'd be more worried about it damaging my phone than about some nebulous "security" problems. I repeat: What do you think it is going to do? Be more concerned about what facebook, candy crush, random programs from the playstore are spying on you than some piece of hardware that has no way to take use of any info it gets from you.
Question: I understand that buying random $3 phone chargers from a bin is foolish, and then having to ask about cutting the data lines in a USB cable is probably further evidence of this, but Android or iOS, is it safe to be picking one of these up and immediately connecting it to my phone? If it had an "extra chip" inside and it was preconfigured for a given OS, could it then do something that would raise issues of security?