178 points · by CrankyBear · 7y ago · 228 comments
The "authentication" that would actually help is to default to only allowing charging through ports (and allow charging without authentication - who cares where I get 65 W of power from? are there malicious electrons?), and show a little "new device" authentication screen with a Bluetooth-style pairing process when I connect something new. Then either burn an asymmetric key onto the device or generate a random symmetric key (and leave the CAs out of it), and on the host, bind the key to the current function of the device, as displayed on the pairing screen. If I clicked "Trust this keyboard," don't let it turn into a CD drive. If I clicked "Trust these headphones," don't let it turn into a keyboard. And so forth.
No idea if that's what this system does, though. Ultimately it has to be the computer itself that knows to protect itself. If insecure USB-C also exists, having the possibility of security may not be good enough.
https://www.amazon.com/gp/product/B01NAWYSVK
UPDATE: actually, no, the displays is upside down on one of my devices! Duh! A cheap gyroscope would help, or another OLED screen on the back but in the opposite direction (as USBC-cables are reversible)
wait I don't get it. It's USB-C, just flip it over?
Very. ASN.1 vulnerabilities have been exploited multiple times in the wild, in mainstream libraries (like OpenSSL). Now imagine every hardware vendor writes their own shitty implementation and ships it as a blob to phone manufacturers. And that's all without going into the full blown X.509 PKI part of the spec, which adds yet another layer of complexity - all under control of chargers you plug into. Now imagine this is implemented by the kind of companies who wish to perform DRM on what charger you are allowed to use.
This spec is a recipe for disaster and implementing it will seriously reduce the security of devices.
2) Historically you never wrote ad hoc parsers. ASN.1 describes a grammar to be consumed by a compiler generator. The X.509 specification and extensions are almost entirely ASN.1 grammars with interspersed commentary. You can feed those grammars directly into the generator, and IIRC I've seen builds where the grammars were extracted directly from the RFCs. OpenSSL and other open source projects suffered from parsing exploits because historically all ASN.1 compiler generators were closed source, commercial products.
I don't disagree that it will likely be ugly. Open source options for properly working with ASN.1 are still poor, and these days even commercial vendors principally rely on open source toolchains. I've used the amazing asn1c which can be fed the official X.509 grammar and spit out a clean, strongly-typed BER, DER, or PER parser. But I've never seen it used by other open source projects. IIRC the mailing-list is mostly chatter from telecommunications contractors.
Bad ASN.1 support doesn't need to be the case. Hand rolling DER parsers is a choice. If we can write good generators for gRPC, we can write them for ASN.1. And from the perspective of C and C++ asn1c largely suffices.[1]
[1] My biggest grip with asn1c is that, IIRC, it still requires dynamic memory for grammars like X.509 with variably sized arrays and strings. It would be nice to see a compiler that supports generating statically sized fields and which simply errors out if an object doesn't fit within the field. Then you could use asn1c for really low-level, embedded firmware, and more importantly could greatly simplify application code traversing the data structures. ASN.1 supports specifying maximum sizes which could be used to size fields (and maybe are in asn1c) but that's a separate thing, and in any event X.509 doesn't make use of this (though I suppose it would be easy to amend the specification, formally or informally.)
It would still allow someone to bypass the authentication if they know the VID and PID of something already authorized with the desired HID class, but that seems reasonable and is significantly better than what we have today.
Are there any systems that work like this today, and if not, is there a reason?
[1] https://en.m.wikipedia.org/wiki/USB_human_interface_device_c...
Having a charging-only-by-default port would be a 90% solution, but would be very annoying for people who need to reauthorize a device every time they plug it in, which is why I think pairing is better. And I'm not sure what devices you can reasonably trust other than pure power. HID is definitely out for fear of Rubber Ducky-style attacks. External video adapters can read your screen. Headphones can listen in on calls. Thumbdrives / PTP devices might be safe if handled carefully but are kind of the classic worry, so I'm not sure if people will want those. Maybe pure U2F devices, webcams, and audio input devices? Not sure how useful or user-friendly such a restriction would be.
If it tries to present another HID later, that would result in a new prompt, the same as a brand new device. If it changes HID while plugged in, that could even be a more severe message along the lines of "Hey, this keyboard just tried to become a video adapter and thumb drive, that's really suspicious and you should probably destroy it with fire".
Likewise, VID/PID changing without being unplugged/replugged in, changing too quickly, or even just after too many new VID/PIDs in a short time period should result in a temporary lockdown -- in the same way fail2ban blocks repeated login attempts from a given IP.
One of the primary drivers for this is the power delivery - imagine a scenario where you have authentic power brick and laptop and buy a counterfeit USB-PD cable, power brick sends 100W over it and it results in the cable melting since it was really a $5 knock-off and you end up with a fried USB-C port in your laptop and possibly a fire. I'm sure most people would wish that the power-brick/laptop checked that cable is genuine and build to handle the power.
Why not implement something like detecting voltage drop between charger and device? Short circuit detection, etc. You can do a lot if you can have both sides communicate with each other, and at that point it matters a whole lot less if your cable lies to you plus you catch a lot of other failure conditions.
Not a USB engineer, but a quick peek at the BC 1.2 spec suggests the ball would have to be dropped on at least two additional fronts for the suggested failure mode to occur:
1.) The Charging Port device vendor for failing to implement any of the allowed shutdown measures suggested in BC1.2 §4.1.4; and
2.) the Downstream Port device vendor for failing to constrain current draw based on sensed Vaca_opr min = 4.1V (Table V) per ibid. §§6.2.2 and 6.3.1.
I can see how the knock-off cable would be toast, and depending on insulation rating, may potentially catch fire, but struggle to see how either the CP or DP USB-C ports would fry (considering they're both designed for a target power).
It’s one of those things that makes USB-C really dumb. Any negligent Chinese manufacturer can drop a cable on Amazon that is a hazard.
In solving all problems, USB-C is a problem.
I find a wonky cable a higher risk than shitty charging equipment, especially as it may work fine for low power needs.
This authentication is supposed to prove that the cables claims have been tested.
It will undoubtedly help safety and compatibility, at the cost of an open ecosystem and pushing prices up.
I figure the authentication will happen largely in the host software as well, so if you're running a real operating system you'll be able to install your own keys.
(Besides, how do you see this working? Are you manufacturing your own USB devices?)
I do (depending on your definition of "manufacturing". I buy USB controller chips to add to my projects), although not USB C.
Now that you bring it up, I do wonder if this authentication scheme will mean that hobbyists won't be able to use it.
But I like your suggestions for pairing.
That 65W of power on USB-C is coming in at 20V most likely. Many devices simply will not tolerate that high of a voltage. This is why authentication and negotiation are absolutely essential.
You can fry a regular AC-powered device by giving it 240 V power instead of 120 V, or 50 Hz instead of 60 Hz, or whatever. But we don't need authentication of power outlets. What makes USB different?
USB-C inconsistency on the hardware side of things has been a meme by itself. With this addition sometimes when you plug a device in it might not work despite being the exact right device/port combination (which would be a miracle on it's own even in the current environment.)
I don't know. Maybe in 5 years when we've glued on all the stuff we want from this connector things will be okay. In the meantime though it's chaos. Committee approved chaos.
USB-C enthusiasts are (from my experience) people who haven't really used it much and think that they will be able to get around with a single cable and a single connector standard.
People who actually tried to use it for a number of things quickly realize that USB-C is just the name of the physical connector, which has nothing to do with what the device supports, which in turn has nothing to do with what the (unlabeled!) cable supports. There are no standards for labeling devices or cables, so you quickly end up in a world where you have a bunch of cables and devices all using a single plug, but you have no idea which device will work with what. I daresay this is a worse situation than having multiple types of plugs and cables, because at least then you could set reasonable expectations.
Add to this the fact that there are no reliable hubs for USB-C connectors, so you're basically stuck with what your laptop/computer offers, unless you want to live in a world of crappy unreliable hardware (I don't).
Well, I'm using it for my monitors, soundcard, power, iPhone/iPad charging, Sony headphones, and external hard disks.
What exactly am I missing from the whole issue, since I don't seem to be having any problems?
Can it be fixed by not buying crappy cables?
Unfortunately that isn't enough yet, as there is no "universal" cable, and may never be. You can have an excellent cable that nonetheless fails for what you plugged it into, or (potentially worse) falls back to something that kind of works (e.g. a slow data transfer through a port that supports PCI-e).
The biggest botch the committee made was not mandating connector labeling. I'd have gone with colors, but not everyone can see them. If the cable had resistor-style stripes to indicate what it supported, and if the ports on the host devices did likewise we'd be in much better shape. Even some licensed logos would have helped though the connectors are so tiny.
Then again the names the USB committee has come up with in the past (high speed, SuperSpeed, 3.0, 3.1 etc) have uniformly been confusing rather than elucidating.
In my case I agree: I have had nothing but success with Type C, and it has simplified my life (except for the lack of high power chargers). But I had to learn more than most people would or should have to in order to get there.
Dude, you're using a pair of headphones that cost more than most people's cellphones and laptops. Normals use years-old Android devices, out-of-date Windows 7 laptops and the absolute cheapest peripherals from the drug store.
Of course that stuff is going to be buggy.
Even the Nintendo Switch, due to its hardware, uses the highly unusual "myDP" USB-C display standard instead of conventional alternate mode.
But it's enough to just read the cable reviews to learn that things are not always fine.
Also, one thing which cannot be blamed on "crappy cables" is that the presence of a USB-C port on a computer does not mean much at all, because in general one has no idea what can be connected to it.
It used to be the case that anything of the same connection type would - at worst - not work if it wasn't designed for that piece of equipment. But now you have a situation where things "kinda" work together so consumers are encouraged to mix and match yet some of the time it could literally break your hardware.
So now we have a situation where some people are too scared to mix and match which breaks the entire point of a standard connection type - and on the flip-side you have other people who are left with bricked hardware because they were unlucky enough to plug the wrong charger with the wrong device (for example).
I have a few modular power supplies around from different vendors, and I made the mistake of using one cable in a different vendors supply.
The supply side had the same connections; so I thought that I could just mix-and-match.
Turns out, that even though the connections are standardized, I ended up putting ground on a 5v pin, 12v on the 5v, 3.3v on the 3.3v (magically) and 5v on the 12v pin on a standard SATA connector.
As a result, I fried several hard drives, because the output of the supplies wasn't standardized for the connector type. I can't even imagine an end-user using a volt-meter to check which are compatible with which vendor.
This was a problem before USB-C.
TL;DL: Check your modular supply cables, and don't use other vendors cables.
That kind of brings me to my next point: proliferation of cables and dongles. Whenever I travel now, I need to have the same USB-A to micro-B cables I was already using, plus some pure USB-C, plus USB-A to USB-C. Not uncommonly, USB-C to micro-B gets thrown into the mix. And the variance across all those is even greater than the pure USB-C stuff. Good luck keeping track of voltage, directionality, data vs. power-only, and all the other variables. For now at least, the addition of USB-C has made things far worse.
I for one would be happier if USB-C were only for laptops and tablets, and all the people making the zillions of smaller devices would FFS stick with micro-B like they were already starting to. Then I'd only need one power adapter, two kinds of cables, and no dongles, instead of this mess.
Text labeling could work, but could get out of control, especially at the rate that the standard is changing. Would it need to list the specific features the cable supports? Or can I assume that a cable labeled with 'Thunderbolt' will be compatible with all future iterations of Thunderbolt?
Maybe we can do something like resistor color codes with colored bands to make a rainbowed venn diagram of cable features. Surely that's a good idea which will only decrease complexity :P
Well, it's clearly less complex than letting the cables unlabeled...
Not everyone! Personally, I couldn't care less what color my cables are (unless the color is telling me something important about the cable).
This is also true with USB A, B mini-A and mini-B, mini-AB, micro-A and micro-B, and micro-AB; also A, B, and micro-B actually have two versions each of the connectors, with compatibility in one direction, so you don't even always know that physical connectors are compatible from the connector name without also the USB version.
If it was designed to have a single connector for charging cables, they were designing to solve a solved problem.
It sounds like USB-C is that, but worse.
(If there's any way to tell what cable is a data cable, I'd love for someone to enlighten me.)
I've had generally good experiences with Type-C and IMHO is an improvement over buying video out dongles for every device and being able to use a single cable for charging.
I connect my desktop to different phones via USB-C, my phone to my headphones, laptop to monitor, my headphones using my car charger, etc. and it all works. The charging bricks and cables are cheap on sale -- $30 for bricks that can charge laptops and about $4 a cable. We're a 100% USB-C household and will only buy electronics with USB-C or USB. I'm waiting for everything else to go USB-C: come on projectors, razors, speakers, and musical instruments.
I suppose my biggest gripe is that things that aren't USB are able to use the USB-C form factor. For instance thunderbolt. My dock at work connects with thunderbolt over USB-C, and everything works fine minus the display port pass through. It's kinda cool that it works at all to be honest. Oddly enough the Ethernet jack and Dock sound card are run over USB so those work fine.
To be fair, OSX warned me something was drawing too much voltage, and I still tried it like 5 times after that, but the screen did flicker on a few times and work for a sec before it all went kaput.
Source: USB-C household with a 9 year old and a new switch.
Was it a cheap USB A -> USB C Cable without a resistor? Those a well known to be dangerous [1]
[1] https://www.howtogeek.com/353410/3-problems-with-usb-c-you-n...
[0]: https://www.reddit.com/r/NintendoSwitch/comments/87vmud/the_...
You're probably right that because USB-C is a newish standard, manufacturers might make idiotic newbie mistakes like the ones Surjtech made with that cable. That would argue in favor of waiting... though I'd estimate that you're more likely to be struck by lightning than encounter a retail USB-C cable with power and ground reversed.
Now we're to trust the same bottom scraping hardware/software makers with an already overly complex serial port.
Not a great situation.
The issues people have had with it seem to be that the Switch dock requests exactly 15V from the power supply when plugged into a TV, and many USB-C power supplies don't support this voltage. The MacBook pro charger supports 9 and 20V (I think), and most others use 9, 12, or 20.
The problem is that there's no indication of what failed unless you're sniffing the power delivery handshake.
(Of course, it's always done "for your security"...)
edit: Keep in mind that a charger meant for a phone is unlikely to provide anywhere enough power for the Switch. You likely need a charger that implements at least USB-C PD.
In short, the Switch does not properly implement the USB-PD standard.
I've heard that third-party chargers work. I could be wrong though.
"hey this is a Samsung USB-C cable, you can't use it. Go buy an LG's one. They are exactly the same except of authentication but we can't trust if otherwise, it's for your safety!"
Than I'll wait for a crying herd of fanboys that proudly try to justify it well pushed by marketing sheepdogs in disguise...
Not exactly top notch reporting here. It is the OSs responsibility to lock down access to I/O resources. Stuxnet was caused by the insecurity of Windows Autorun, not USB.
Also, unless literally every “trusted” USB-C device has its key and its core functionality on a secure chip, the bad guys will just compromise a signed device and make it malicious. As far as I know, many, many USB devices can have their firmware replaced with no authentication whatsoever.
I welcome the world where machines trust my CA and someone who wants a USB device just comes to me, signs the paperwork, and leaves with a signed device that suddenly just works.
I mean pushing the security boundary to "someone with the knowledge to flash USB firmware without corrupting the certificate" is pretty darn good.
Digicert surely welcomes this world! I personally don’t expect Digicert to have any real controls at all.
Also, right now, to put malware on a USB stick, you can just write malware to it. To create a USB stick that has malicious firmware to attack the host drivers, you need a USB stick that doesn’t protect its firmware or you need to build your own. In the new world, this changes to, drumroll please, a USB stick that neither protects its firmware nor wipes its key when new firmware is uploaded. Or you can build your own and pay Digicert, or you can attack a machine that doesn’t bother validating the signature because it wants to retain compatibility with the billions of existing unauthenticated USB sticks.
Also, if devices need per-device keys, then I suspect that firmware upload won’t wipe the key, since otherwise firmware upload mostly breaks the security model unless some rather complicated checks on the firmware upload process are done.
USB-C devices are cheap, and they’re made by tons of vendors, many of whom know about voltage conversion but not security. Heck, most of these vendors, even big names like Nintendo, can’t even be bothered to speak the protocol correctly.
EDIT: Yea, I know I'l probably cause some amount of damage in the process.
No it's not! Badly designed cables and chargers have been damaging devices via power-only ports for decades.
I guess another question is, why did we need "secured" x509 USB? whos pushing this standard?
For example, the Porsche 911 comes with single lug wheels...theyre exotic enough to take their own special wrench, at four hundred dollars, for no real reason other than 'racecar.' youll never race it at speeds where this F1 class hardware matters, but hey, racecar.
I don't know about the particulars of this standard though, maybe it's just some DRM thing and soon you'll have to buy expensive dell mice for dell laptops or something like it's already the case with gamepads and consoles.
[1]: https://srlabs.de/wp-content/uploads/2014/07/SRLabs-BadUSB-B...
I was curious so I looked it up, here's their very expensive torque wrench [0]. Here's some pictures of guys holding it [1].
It seems weird to me to complaint about requiring specialty tools for a specialty car. It's not like there aren't a ton of car options to chose from.
[0] https://www.tooltopia.com/precision-instruments-c4d600f36h.a...
[1] https://www.thextremexperience.com/blog/insane-torque-wrench...
This will mostly be a deterrent for opportunistic thieves, the same reason you lock the door of your home. Even locked, it is still easy to open with the appropriate tools.
The 'I trust this device' system allows confirming that you trust the device. This crypto confirms that the USB-IF trust the device (and presumably all they are asserting is that the device conforms to standard).
It's an interesting idea, and not a bad one. That's assuming the certificate system is sound which I remain sceptical of until I know more, given the normal issues with managing a single unrevocable private certificate.
Seems... low, esp for an offline device that you can get hands on both sides of. How many chargers are going to use as cheap a micro as possible for this?
Also, adding an encryption layer and further fragmenting - does have the benefit that Apple may make iPhones with TypeC connectors... so, hooray?
Why did they have to go down the 'trust' rather than 'distrust' route? It is a completely different universe from the principle of least privilege.
Just like Spectre/Meltdown: half of all people will just shrug, completely unsurprised, when the inevitable zero day drops. And the split between those that find the sky falling, will be the clueless and the plants. Whatever.