Hacker News new | ask | show | jobs
by sharpneli 3786 days ago
It was not a slight fezz-up. It was miswiring in a power cable. It's like electrician wiring the live pin into ground pin and then wondering why one gets electrocuted by so many devices.

No specification can defend against a hostile, or sufficiently incompetent, implementer.

3 comments

It's what fuses and diodes are used for. You know how when you write a program you never trust user-input? This should be the same thing, but physically. A well-designed USB port wouldn't fry the computer like it did.
There is a limit on how much user malice should be tolerated vs the cost (additional components used, larger devices etc etc) to implement all of that. Especially as someone can always just rip the device open and circumvent all that causing breakage. How many stops there should be versus malicious usage?

USB devices can handle things like the ground and voltage being shorted, as that can happen in normal use through wear and tear. However the flip of ground and voltage lines can only happen if it is done intentionally. As an example either by malicious user or by a factory just randomly mashing wires together and then lying to the customers that they're selling an USB cable.

Or an untrained or too-tired worker puts the assembly in the jig upside-down and pushes the button. ker-chunk. Then the worker throws the cable in the good bin because he gets paid by the kg of cables produced, and fired if the bad bin fills up.

It's 5A, they could install a polyfuse, or they could monitor the current and turn it off with a transistor.

As I already explained in the previous thread about this cable, current limiting is implemented in USB hosts and chargers and it doesn't help in this case. If the powered device sinks more than 5A of reverse current, it already is dead.

For protection from reverse voltage, the powered device needs a circuit which detects negative voltage and disconnects power (which would easily consume few cm² of PCB area) or a very beefy clamping diode to shunt the negative current into ground before it reaches other circuits and pray that charger's current limiter trips before the diode overheats and vaporizes.

And even if you do that, some idiot can still make a cable which applies -5V to some data line instead of the power line, so that your whole unobtanium Intel southbridge chip goes poof. Are you going to multiply the protection circuit by the number of wires in USB3 cable and at the same time make it pass insanely fast signals without distortion?

At some point you have to give up and simply assume that cable vendors are at least minimally competent.

Is that really true? (I have no idea just asking). Is there nothing you could put in the device to prevent bad inputs from damaging the internals? (for some definition of bad)

Is it a question of impossibility? Or cost? Or bulk? or something else?

I thttp://www.fiftythree.org/etherkiller/ttp://www.fiftythree.o... it's a matter of foreseeing the potential failure modes and correctly deciding which ones are so remote as to be not worth the cost and complexity to protect against. For instance, I don't think there's a consumer device out there that wouldn't fry if connected directly to mains AC through any peripheral port at all. But that doesn't stop someone from making a cable that connects AC to USB and saying it's a fast charge cable on Amazon. That's a more extreme case than this, but only because it's more obvious what the flaw in the cable is.
A cable with a mains plug at one end and USB on the other is obviously wrong, though.

Mains power is legitimately difficult to deal with. Power that's five volts out of spec is not.

A cable that puts 5 volts into random pin is also obviously wrong.

It's a balancing act between the probable failure modes and the cost of replacing the broken devices. Hostile manufacturers is not common enough of a failure mode (vs just Amazon sending a replacement device) to accept the additional cost for every single unit made. It makes no sense to spend 1 dollar more per device if it saves 1 cents per device on average for replacement costs.

If this kind of issue becomes more common then it might make sense. But for now it doesn't seem likely.

>A cable that puts 5 volts into random pin is also obviously wrong.

I mean that the physical object is obviously wrong. Such a cable looks like any other cable.

Just as a side note, some of the cheapest USB chargers have 1mm or so of clearance between high voltage and low voltage circuits, which places them one small accident away from the "mains to USB adapter cable" territory.
I know, but that's not a cable. You need more diligence when buying transformers, but a wire with a plug shouldn't be able to do unexpected damage.
Sorry about the weird url problem. I typed this on my phone in the HN app and had tried pasting in a URL at the end of my text. After being seemingly unable to get the URL to show up after two tries I gave up and cut down my post to not talk about the URL. I seem to have somehow inadvertently double pasted said URL to the beginning of my post in the process of all that.
I have actually seen a wall plug with V- and GND mixed up. Luckily nobody was injured and nothing was set on fire, but we did wonder why touching the dishwasher gave us a noticeable shock until we figured out what was wrong.
Assuming you mean neutral and ground, at least those are nominally the same voltage. If you mean something else then I'm going to need more explanation of what wires are in that plug, and I'm slightly terrified that it still ran.