Skip to content

Latest commit

 

History

445 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openpilot/etc. on Toyota/Lexus/Subaru with TSK/ECU SECURITY KEY/SecOC

1

Toyota's Sword in Rock situation (that has been pulled out quite a bit by Willem and Greg!)

The comma.ai Discord isn't really a good place to store answers or guidance to questions about the situation with Toyota's TSK/ECU Security Key/SecOC and openpilot. Discord's search is terrible, and the content inside of it isn't accessible to search engines. This is an attempt to document some of the discussion and information about the situation with Toyota's TSK/ECU Security Key/SecOC and openpilot in a more accessible way.

Tip

This document is a bit long, you may want to put the URL of this document into your 🤖 AI assistant of choice to ask it questions about the contents of this document. Ask DeepWiki is a good choice for querying with citations and references. Note that DeepWiki may lag behind the latest copy of the document by a week.

https://deepwiki.com/optskug/docs

You are encouraged to share DeepWiki conversations links in Discord if you aren't sure it is interpreting this document correctly or if you have follow up questions that it can't handle.

Of course, other AI assistants such as ChatGPT, Claude, or Gemini can also be used once you pass them the URL of this repository: https://github.com/optskug/docs


Table of Contents


Background

tl;dr: Toyota started to use cryptographical signatures to block openpilot (and other hacks). Some smart people in the industry hacked the signatures for some cars, but not all cars. Community research is active again: firmware-specific EPS patches have demonstrated lateral control on newer HSM-equipped Toyota variants, but the work still has integration rough edges and can leave an EPS difficult to recover.

openpilot, in order to control the latitude (aka. steering), needs to be able to man-in-the-middle the steering control messages used by the lane keep assist system. It blocks the original steering control messages and replaces them with its own. Latitude-controlling messages originally come from the forward-facing camera, which is also known as the "Forward Recognition Camera" or "Object Recognition Camera" in Toyota vehicles. The camera is responsible for the lane keep assist in Toyota vehicles.

There is a STEERING_LKA-ish message and more in some new Toyotas that currently has an "authentication code" scheme appended to the end. The algorithm and security system for this "authentication code" is somewhat known for certain vehicles but requires a key that is unique to each vehicle to be extracted or smuggled out of the vehicle (https://icanhack.nl/blog/secoc-key-extraction/). Not all vehicles are able to have their keys extracted with what is currently known. Without the key for each vehicle, third parties like comma and users cannot control the vehicle. While vehicles that have had their keys smuggled out are currently working with openpilot.

Most work on the issue still builds on what Willem and Greg accomplished. Beginning in July 2026, 3b1b.eth dumped and analyzed the firmware from a purchased 8965B4512000 Sienna EPS, then published a firmware-specific patch in August that bypasses SecOC verification on the EPS receive path. The existing key-extraction exploits discovered and built by Willem and Greg still are not known to work generally on newer HSM-equipped vehicles.

Firmware modification to bypass EPS-side SecOC verification has now produced experimental lateral-control results on a 2024 RAV4 Prime and a 2026 PRC-made Sienna. Early Sienna testing included LKAS deactivation, but a later follow-up reported stable operation and attributed the remaining minor issue to openpilot's handling of a mixed state in which EPS frames no longer require SecOC while other frames still do. These remain firmware- and vehicle-specific demonstrations rather than general support, and separate live EPS experiments have shown that failed patches can leave recovery difficult or impossible without replacing the EPS.

Note

Toyota is not alone in implementing encrypted CAN bus systems to block ADAS additions. For example, Ford has been rolling out their Trusted Realtime Operating Network (TRON) on CANFD vehicles starting with the 2023 Superduty. GM has likewise rolled out its Global B architecture, also known as the Vehicle Intelligence Platform (VIP), on newer vehicles; affected Global B vehicles are currently incompatible with openpilot. You can check the Confirmed TRON Status List on Blue Pilot for more details on affected Ford vehicles that are likewise currently incompatible with openpilot.

Unresolved Mysteries

The following is not comprehensive.

  • The exact details of how the process of how Toyota's tools communicate with the vehicle and their servers, and how the key is updated for multiple ECUs is still not fully known or experimented with. A high level overview of the process is known, but not the exact details.
    • Could a simulation of an extraneous "blank" vulnerable ECU into the system be tacked onto the communication with Toyota to extract the key?
    • There's something with Master ECUs and Slave ECUs here.
  • The 2023 US made ICE Corolla (VIN starts with 5) is a TSS 3.0 vehicle that does not appear to have ECU Security Key or SecOC steps when replacing the forward camera. However, the first known CAN logs from one of these cars show key-like count and authentication fields on STEERING_LKA, STEERING_LTA, and BRAKE_2. It remains unclear whether this is TSK/SecOC, a hardcoded key, or another authentication scheme.
  • Can the demonstrated EPS firmware-patch approach be made stable, safely recoverable, and portable across other firmware and vehicle variants?

Cars

🟢 Successfully running openpilot

These cars can run openpilot but are not listed on https://comma.ai/vehicles#toyota or CARS.md because comma.ai (the company) understandably doesn't want to own the security key hacking process.

If it is on https://comma.ai/vehicles#toyota, then it's supported by comma.ai for openpilot. At the moment, all harnesses for pre-existing and non-TSK/SecOC supported Toyota vehicles are Toyota Harness A and can be used with TSK/SecOC supported vehicles.

Follow the Setup Guide below and you'll have it working.

  • 2021-2023 RAV4 Prime/PHEV aka. Plug-in Hybrid
  • 2021-2026 Sienna Hybrid (US-made), 2021-2022 Sienna Hybrid (Mainland China-made)
  • 2020-2022 Yaris Hybrid (EUDM/JDM/MXDM)
    • All Trims supported
    • Toyota Harness A
    • Dataflash dump hack works as the key is not in the same address as RAV4 Prime in program memory
    • Brute force efforts to find key location successful on both European and Japanese Yaris Hybrid. European user eventually gave up full installation due to unrelated C3 malfunction.
    • I-CAN-hack/secoc#4 - brute force dataflash dump approach used to locate and extract the SecOC key
    • First Continental Radar + Camera setup going and thus first radar controlled ACC vehicle done with. This does not mean longitudinal is controlled by openpilot though.
      • Experimental work in disabling the radar has shown this does is not enough to let openpilot control longitudinal.
    • Not sold in the USA, but is in Australia, Japan, and Europe
    • Only one guy using it in Japan and one guy in Poland, unfortunately. Help increase the population!
  • 2021 GR Yaris (EUDM/JDM/MXDM)
    • All Trims supported
    • Toyota Harness A
    • Memory dump hack works but the key is not in the same address as RAV4 Prime.
    • Same hardware as Hybrid Yaris with Continental Radar + Camera
    • Manual Transmission
    • One user in Poland at the moment. lx93.
    • WIP

Notes

  • These vehicles have TSS 2.0 ~ 2.5.
  • These vehicles do not use the HSM.
  • These all seem to share the commonality of a version 1 bootloader on the EPS2. On 24+ Siennas we're seeing 02 bootloader. This means 02 bootloader is no longer a mark of unhackability.

🟠 Tried but no key extracted yet

Code execution works and we can dump the memory/dataflash, but no keys found in the dumps yet.

If you have one of these cars, please stop by the comma Discord's #toyota-security channel - we need more information from people like you. Please bring build date, VIN origin, EPS part number and identifiers, CAN logs, dump behavior, and both successful and failed attempts.

  • 2023 Corolla Cross Hybrid
    • TSS 2.0
    • Code execution: yes. Memory can be dumped but the key is not in visible memory.
    • Mentioned in Willem's blog post.
  • 2023 US-made Corolla (VIN starts with 5)
    • TSS 3.0.
    • Code execution: yes. A codeflash/RAM/DataFlash dump package from one 2023 Corolla ICE was publicly shared for offline firmware analysis in August 2026.
    • The first known CAN logs show changing count and authentication fields on STEERING_LKA, STEERING_LTA, and BRAKE_2, indicating some kind of key or authentication is present.
    • No key extraction, firmware patch, or working openpilot port has been reported yet. Next steps include testing TSK Manager and analyzing the codeflash for portable patch points.
    • This is not the same as the 2023 TMC/JP-made Corolla or the 2024+ Corolla.
  • 2024 Highlander ICE and Hybrid
    • TSS 2.0
    • Code execution: yes. Memory can be dumped but the key is not in visible memory.
    • 02 bootloader2
  • 2024+ RAV4 Prime/PHEV aka. Plug-in Hybrid
    • TSS 2.0
    • Code execution: yes. At least code is executed. Unknown what might have changed.
    • Key at least not at the same location as other RAV4 Prime.
    • New 02 bootloader2 seen.
    • Reports:
      • Not Working
      • Experimental firmware-patch report
        • yc - 2024 RAV4 Prime reports lateral openpilot control working on a Comma 4 after patching the EPS to bypass a SecOC validation check, forcing the 2021–2023 RAV4 Prime profile, and installing a dummy SecOCKey. yc later reported four or five driving sessions without an issue, but still gave no guarantee that the procedure could not brick the EPS. This remains a single-car experiment, not a general compatibility result.
  • 2023+ Sequoia (Speculated from being a Tundra with an SUV Body)
  • 2023+ Sienna (Mainland China-made)
    • Separate from the US-made Sienna in 🟢 Successfully running openpilot. ⚠️ General support remains unconfirmed: one owner reports lateral openpilot working on a 2026 PRC-made Sienna after an EPS firmware patch, but this is not evidence for other vehicles or EPS revisions.
    • Toyota Safety Sense generation does not map cleanly to Toyota TSK / ECU Security Key / SecOC behavior.
    • Code execution: yes on the reported 8965B4512000 EPS.
    • ⚠️ The reported result is lateral-only; factory longitudinal control remains enabled. Firmware modification is a high-risk experiment with possible EPS bricking and difficult recovery.
    • Existing data points are mixed and confusing: a Mainland China-made 2022 Sienna owner in Frogpilot Discord reportedly extracted a key but got stuck writing params, while later 2023+ Mainland China-made examples failed or showed changed identifiers.
    • calvinspark later noticed an August 2023 Mainland China-made Sienna that did not dump had an 0x01 app identifier and 0x02 bootloader2 identifier.
    • Reports:
  • 2022+ Tundra (Confirmed in commaai/openpilot#27869 (comment))
    • TSS 2.0
    • Code execution: yes. Willem reported getting the exploit to run on a 2022 Tundra EPS, but said the EPS uses an HSM.
    • Tim tried the Sienna-style DataFlash candidate verifier and reported no luck.
    • Relevant source links: Willem's 2022 Tundra EPS / HSM update, Tim's June 2026 Tundra test thread, and the public I-CAN-hack/secoc tundra branch.
    • User ThisGuy has an extra rack on the bench. Sent to Willem for further analysis. Uses HSM, possible firmware mod approach to disable SecOC in planning. See July 2025 update below.
    • ⚠️ Tim's later live firmware-mod attempt produced random DTCs and could not restore the stock EPS firmware in that attempt; treat firmware modification as a high-risk recovery problem, not ordinary vehicle experimentation.
    • 04 bootloader2
  • 2021+ Venza
    • Code execution: yes. Key at least not at the same location as the RAV4 Prime.
    • Has a 02 bootloader2 though from two 2021 samples.
    • Reports:

🔴 Not hacked and can't run openpilot

These fall into a few categories:

  • Introduced in 2022+ with TSK/SecOC but it's strongly suspected that they have an updated chip that precludes the existing exploits from dumping the key. (Most)
  • CAN Bus captures from these vehicles are unlikely to be of use for any research until someone figures out how to get into the ECUs themselves. In other words, you can't tell much from ciphertext.

The List:

  • 2022+ Aygo X (EUDM)3
  • 2023+ Aygo X (Euro tech info Lookup)
  • 2023+ bz4x3 (Probably the same for sister rebranded Subaru Solterra)
    • A 2025 bZ4X experimental EPS-patch report says the stock camera produced no errors after the patch, but openpilot still needs TSS 3 message support. This is not a reported working openpilot port.
  • 2025+ Camry3
  • 2023 TMC/JP-made Corolla3
  • 2022+ Corolla Cross (USDM, not applicable to Thailand, Brazil, or Taiwan)3
  • 2024+ Corolla/ Corolla Hybrid, All origins.
  • 2023+ Crown
  • 2024+ Grand Highlander ICE and Hybrid3, 2024 Crown Kluger ICE and Hybrid (PRC, elsewhere?)
  • 2022+ GR Yaris (EUDM/JDM/MXDM)
  • 2025+ Highlander ICE and Hybrid3
  • 2024+ Mirai3
  • 2023+ Prius and Prius Prime/PHEV3
  • 2024+ RAV4 in Europe (techinfo)
  • 2024+ Tacoma3
  • 2021+ Yaris Cross Hybrid (EUDM/JDM/MXDM)
    • Emna tried optskug/secoc key extraction and reached programming session / seed generation, but the computed key was rejected with SECURITY_ACCESS - invalid key.
    • This now has a concrete negative datapoint rather than only "hasn't been tried" speculation.
    • The likely next step is not merely rebuilding payload.bin; someone probably needs to figure out the correct security key / SEED_KEY_SECRET, possibly by following Willem's sacrificial EPS reverse-engineering path.
  • 2024+ Lexus GX3
  • 2022+ Lexus LX, NX3
  • 2023+ Lexus LS3
  • 2023+ Lexus RX, RZ3
  • 2024+ Lexus TX3
  • 2025 Lexus ES Hybrid (Korean import)
    • Reported on April 19, 2026 on the sunnypilot forum as showing dashcam mode, unrecognized car before manual selection and unknown vehicle variant after manual selection.
    • Reported VIN starts with J.
    • sunnyhaibin's follow-up log review found PCM_CRUISE only when using the SecOC DBC along with 0x0F / SECOC_SYNCHONIZATION.
    • This strongly suggests that this market-specific variant is affected by TSK/SecOC.
    • Do not generalize this finding to all 2025 Lexus ES vehicles.
  • 2025 Lexus ES (China-market / PRC)
    • Long (long047829) reports TSK/SecOC-style checksum failures on a China-market ES2025 while using openpilot.
    • This is a separate market-specific report from the Korean-import ES Hybrid and should not be generalized to all 2025 Lexus ES vehicles.
  • 2025+ Lexus UX3

🔵 Vehicles not in comma's supported vehicles list

The following vehicles aren't in comma's supported vehicles list but are known to not have SecOC/TSK.

They may not have been added due to:

  • Bugs in the automated process of adding vehicles to the supported vehicle list such as in the case of the 2025 Lexus ES.
  • No one has tried it!
  • Sometimes no one has tried that specific year and sent in evidential data that comma will accept to put it on the list. This sometimes results in weird year gaps on comma's list even if its other years in the same generation/facelift are supported.
  • No development has been done on it.

However, they are confirmed on Toyota Techinfo to not have SecOC/TSK.

These vehicles are not TSK vehicles and might just be a fingerprint away from being supported by openpilot.

Vehicle status notes in this section are for the US market unless otherwise specified.

  • Taiwan-market Corolla Cross
    • TSS 2.0
    • No TSK/SecOC.
    • Locally built / Taiwan domestic-market model.
    • Saber422 reports that the 2026 Taiwan Corolla Cross is still TSS2.
    • This is not a hardware hack or bypass situation. The Taiwan Corolla Cross simply appears to be a market-specific non-TSK case, similar to the Thailand-market Corolla Cross situation.
    • Not known to be openpilot-supported yet. It likely needs normal route/fingerprint work rather than key extraction.
  • 2021 Lexus RC
    • TSS2
    • No TSK
  • 2022, 2024-2025 Lexus RC
    • TSS2.5
    • No TSK
    • No one has tried
  • 2020 Lexus IS
    • TSS+
    • No one has tried
  • 2021 Lexus IS
    • TSS2.5
    • No one has tried
  • 2025 Lexus ES Non-Hybrid
    • In the US market, this seems to have issues being auto-added to comma's supported vehicle list for some reason.
    • This should not be read as covering non-US variants such as the Korean-import 2025 Lexus ES Hybrid noted above.
  • 2024 Lexus UX
    • Last year without security key according to TechInfo.

Unknown

If your car is not listed above, then there has been no documented information or attempts. Please talk to us at the comma Discord's #toyota-security channel.


Setup Guide

Key Extraction

Your car has a security key that Toyota doesn't want you to have.
Follow this guide to run a hardware exploit to extract the key.

Step 1. Install TSK Manager

44-second overview.

18-minute real-time demonstration. Turn on the captions.

If you have a C3

  1. Install openpilot.
  2. Uninstall openpilot.
  3. On your computer, do one of these.
    • Yes, a computer is required.
    • 192.168.x.x is comma's IP.

Mac Apple Silicon

curl -fL https://github.com/ophwug/agnos-waiting-for-internet-debug/releases/latest/download/agnos-waiting-for-internet-debug-darwin-arm64 -o agnos-waiting-for-internet-debug

chmod +x agnos-waiting-for-internet-debug

./agnos-waiting-for-internet-debug --ip 192.168.x.x --custom-software-url https://installer.comma.ai/optskug/tskm-c3

Mac Intel

curl -fL https://github.com/ophwug/agnos-waiting-for-internet-debug/releases/latest/download/agnos-waiting-for-internet-debug-darwin-amd64 -o agnos-waiting-for-internet-debug

chmod +x agnos-waiting-for-internet-debug

./agnos-waiting-for-internet-debug --ip 192.168.x.x --custom-software-url https://installer.comma.ai/optskug/tskm-c3

Linux

curl -fL https://github.com/ophwug/agnos-waiting-for-internet-debug/releases/latest/download/agnos-waiting-for-internet-debug-linux -o agnos-waiting-for-internet-debug

chmod +x agnos-waiting-for-internet-debug

./agnos-waiting-for-internet-debug --ip 192.168.x.x --custom-software-url https://installer.comma.ai/optskug/tskm-c3

Windows

curl.exe -fL https://github.com/ophwug/agnos-waiting-for-internet-debug/releases/latest/download/agnos-waiting-for-internet-debug.exe -o agnos-waiting-for-internet-debug.exe

.\agnos-waiting-for-internet-debug.exe --ip 192.168.x.x --custom-software-url https://installer.comma.ai/optskug/tskm-c3

Step 2. Install the hardware

Caution

Your phone charging cable will not work here. For connecting a comma device to the harness, always use the official OBD-C cable that came with the comma device. comma.ai sells it if you need more: https://comma.ai/shop/obd-c-cable. If you must buy your own, USB-C 3.1 Gen 2 is required.

Turn on the captions.

Step 3. Extract the key

Caution

The 12V battery will die in 10 minutes when you're in Not Ready to Drive mode.

Turn off the A/C and never stay on this mode for more than 5 minutes at a time. After 5 minutes, start the engine and leave it running for 5 minutes before trying again.

The 12V battery is not your hybrid driving battery. It doesn't matter that your car is charged to 100%.

THIS IS IMPORTANT! Many people had to jump the car, so I'm telling you. Please listen. Do not stay on this mode for more than 5 minutes.

Turn on the captions.

Step 4. Install openpilot or sunnypilot

Turn on the captions.

If sunnypilot goes into Dashcam Mode, check Settings > Toggles > Enable sunnypilot.

Step 5. Tell us how it went

Did everything go smoothly? Was something not clear? Did you get into a state that's not described in the videos?

Please let us know! We've put in lots of effort into this, so even a simple "It worked out well" comment is appreciated.

We're in comma Discord in #toyota-security channel.

Advanced Topics

Install a known key

In some cases it's possible to type in a key that you already know. This was made when the key extraction was just getting started.

If you're comfortable with SSH, do this with your key.

sudo mkdir -p /cache/params
sudo chown comma:comma /cache/params
echo -n 0123456789abcdef0123456789abcdef > /cache/params/SecOCKey
sudo reboot

Run the 21-23 exploit using SSH manually

Is a GUI button too easy for your engineering spirit? Here is how to extract the key manually.

Run the 24+ exploit using SSH manually

VanceLiu/Vance425 and thehui/bkai201 built the same 2024+ hack in a different packaging. See https://github.com/Bk2ol/tsk_extraction_by_can_log.


FAQ

Q: Can I use one comma device with both a SecOC/TSK vehicle and a non-SecOC vehicle?

A: Yes, this should be fine. The SecOC key can remain installed; openpilot should simply not use it on the non-SecOC vehicle.

Switching between two SecOC/TSK vehicles is where it gets annoying. The key is vehicle-specific, so the correct key needs to be present for whichever SecOC/TSK vehicle is being driven.

Changing forks is still a reinstall/flash process, not a built-in dual-boot or per-car preset switcher. Pick a branch or fork that supports the vehicles you plan to use.

Source: comma.ai Discord #toyota-security


Forks

Caution

Using forks presents a real danger. Do your research!

Begin your research in comma.ai Discord's #custom-forks.
Please do not ask about forks outside of that channel.

Note

All forks support lat, MADS/AOL, and long, unless noted otherwise.

  • Lat is lateral support which means openpilot can use the steering wheel.
  • MADS/AOL are features in sunnypilot and FrogPilot that keep the steering wheel control engaged even after applying brakes.
  • Long is longitudinal support which means openpilot can use the gas and brake pedals.

openpilot

URL

  • C4: commaai/nightly-dev
  • C3X: commaai/nightly-dev
  • C3: Not supported. Product support ended so use a fork instead.

Notes

  • Not a fork but an alternate branch from comma.ai with TSK support.
  • Install this if you need support from comma.ai's support. They won't talk to you if you're on a fork.
  • Pre-compiled, so quick to install.
  • It has the most up-to-date changes, which is cool, but it could get unstable.
  • Supports lat and long, but no MADS/AOL.

sunnypilot

URL (Source)

  • C4: install.sunnypilot.ai/release-mici
  • C3X: release.sunnypilot.ai
  • C3: install.sunnypilot.ai/staging-tici

Notes

  • Release branch of sunnypilot is extensively tested by the Toyota SecOC community.
  • Model switcher to easily switch between various AI models.
  • NNLC: Big steering improvements for '21-23 RAV4 Prime and Sienna.
  • sunnypilot complies with comma.ai's safety rules as accurately as possible.
  • C3 branch (staging-tici) is slightly older than release but similarly capable at the moment.
  • Forum: https://community.sunnypilot.ai

FrogPilot

URL

  • C4: Not yet supported
  • C3X: frogpilot.download
  • C3: frogpilot.download

Notes

  • Uses an old AGNOS version. When downgrading, OP may get stuck in a registration loop. In this case, tap-tap-tap on the boot logo and reset the device to recover and then install again.
  • ‼️ DO NOT RUN FROGPILOT DEEP STORAGE DELETE. It deletes your security key, and you have to run TSK Manager again. Run it only when you're selling the device.
  • Discord: https://discord.com/invite/frogpilot

SatoPilot

URL

  • C4: Not yet supported
  • C3X: alexandresato/personal3
  • C3: alexandresato/personal3

Notes

  • First fork to get long!
  • Very quick stop-and-go response.
  • alexandresato/extract_secoc_key_btn includes a TSK key extract button and is rebased with personal3 often. The button is only for C3 & C3X, not for C4.

Others

If you are installing a fork not included in the list above, find the fork author and ask the following.

  1. Does it meet the safety standards from comma? Using a fork that doesn't meet the safety standards will get you banned from comma.ai servers.
  2. Is it for the latest C3X or C4? A fork for an older comma device may brick your C3X/C4.
  3. Does it support SecOC/TSK?
  4. Does it contain banned code? Using a fork with banned code may get you banned from comma.ai servers.
  5. Is there anything to watch out for?

If you can't find the author, don't install the fork!


Discords of Note

Most if not all Discord links are to the comma.ai Discord accessible with an invite from https://discord.comma.ai unless otherwise noted. These other Discords include:

The activities, actions, and discussions on non-comma.ai Discords are/may not supported by or affiliated with comma.ai (this may even apply even to the comma.ai Discord too). In the case of MoreTorque, comma.ai is strongly opposed to that community/Discord. That said, the ECU Security Key issues affects all and relevant events and information may be there as well.


Bounty Statuses

🗳️ comma.ai Vote for Toyota Security

In June 2022, comma.ai created a paid vote/crowdfund for making openpilot support Toyota Security. Once they get 500 votes at $100 a vote, they have 6 months to figure it out and open source a solution; Otherwise, a refund will happen and all the money is returned. The current status of that was: Latest Comma Vote Count for Toyota Security ($100 ea.)4 .

Vote counts were reported every week or similar and are recorded in this spreadsheet by the community: https://docs.google.com/spreadsheets/d/1GOeN2ph9JLvOlwStZso988YPT-lILl7yZqFW8UPCFZM/edit#gid=0

The result of this vote, even though it has not met its target cost, is a pull request was produced for the RAV4 Prime to be supported in openpilot. It was eventually merged in.

In January, the vote page was taken down. Below is a snapshot.

image

The last known vote count from community observations:

4

115/500 votes.

In addition to their vote system, comma also has/had specific bounties up:

👥 Communities Bounty

The overall community bounty has been canceled for numerous reasons:

https://www.reddit.com/r/Comma_ai/comments/1d5r7xr/comment/l6vjf9e/

Original Sheet: https://docs.google.com/spreadsheets/d/1MKS78_utvbAe74Xv7zszgEnn6JrtBgpgYlVOfoIvLEw/edit#gid=0

Specific Community Bounties

In its place are more specific community bounties:

Pictures of TSK'd and non-TSK'd Camera ECUs

FWIW the outside of the ECU Security Key camera of a Rav4 Prime looks the same as a non-ECU Security Camera of a Corolla or Corolla Hatchback.

2021 Rav4 Prime:

image

Security Key'd Denso innards: https://discord.com/channels/469524606043160576/905950538816978974/939203494152372274

2020 Corolla/Corolla Hatchback:

IMG_20200831_164627

A photo teardown of the 2020 Corolla camera (NON ECU SECURITY KEY) innards: https://photos.app.goo.gl/qsBaMFT6PSEs7BFXA

Current History

Here's a brief to get anybody going into this ECU Security Key issue up to speed. I'll keep updating this with links to the relevant Discord messages and other stuff as I find them.

Discord links may be linking to the middle of the conversation. Scroll up and down for context.

Many of these Discord links are to the #toyota-security channel in the comma.ai Discord. For a list of other relevant Discord servers, please see the Discords of Note section.

Background

For Toyota openpilot enthusiasts, the community was very excited for the RAV4 Prime, a high performance Toyota that was going to have "Toyota Safety Sense 2" (TSS2), other awesome Toyota traits such as reliability, utility, and economy, and, new for a Toyota SUV, speed. It is the fastest accelerating real Toyota excluding Lexuses as the Supra, a BMW badged as a Toyota, does not count.

Previously seen TSS2 vehicles have had an architecture where both latitude and longitudinal are both controlled by the front-facing camera. openpilot was able to intercept and control latitude and longitudinal all at the front-facing camera of TSS2 vehicles, promising full openpilot capabilities. No other taps in the CAN of the vehicle were needed to control or block messages for this capability.

The typical process for adding a new TSS2 vehicle is simply creating a fingerprint with reference to the closest similar vehicle and trying it out.

Timeline

2013

August 2020

matty#8553 came on Discord as the first user with a RAV4 Prime and a new Comma 2. crazysim#7797 / @nelsonjchen offered to get the RAV4 Prime supported. Some worrying observations were immediately made in a GitHub issue after validating that the hardware was sound and working on another non-Prime TSS2 RAV4 :

October 2020

November 2020

December 2020

January 2021

February 2021

March 2021

April 2021

May 2021

June 2021

July 2021

August 2021

September 2021

October 2021

November 2021

December 2021

January 2022

February 2022

March 2022

April 2022

May 2022

June 2022

July 2022

August 2022

September 2022

October 2022

  • gsmdev posts about their experience with RE'ing Toyota ECUs
    • Me have experience with Toyota reverse engineering and CUW files.
    • On fresh firmwares Toyota have fully change algorithm. On firmwares with SeedKey ; Nonce. They use AES CBC for encryption. And AES CMAC for final check. Inside PC software they convert SeedKey to 128 bit Array. This seed used for encrypt firmware. AES_ECB(BL_KEY, SeedKey, SessionKey) - Take from bootloader BL_KEY 0x10 bytes inside firmware bootloader region and encrypt via AES_ECB with this key and input data SeedKey. Out from AES will be SessionKey. And this SessionKey used to encryption data with AES_CBC.
    • About NONCE - it used On final stady after writing firmware. Is AES-CMAC of whole firmware update. After checking AES-CMAC bootloader write signature inside firmware region like it correct. If this will be not maked. Firmware will never run after reboot. Module will be allways in bootloader mode.
    • About Compression i have never seen before CUW with compression. If some one have readed fullflash from module with support compressed update. I can help with reversing. Also can help with reversing other parts.
  • Remote starters with no key do exist on Toyota Security vehicles.
  • (RP Discord) In which a crew of people work through RE'ing some firmware on an EPS for their VWs.

November 2022

December 2022

January 2023

February 2023

March 2023

April 2023

May 2023

June 2023

July 2023

August 2023

September 2023

October 2023

November 2023

December 2023

January 2024

February 2024

March 2024

  • Major Update from former comma staffer Willem Melching:

    • New blog post is out! Extracting the SecOC keys used for securing the CAN Bus on the 2021+ RAV4 Prime. https://icanhack.nl/blog/secoc-key-extraction/

      Research started all the way in 2022, but took many evenings of reverse engineering to get code execution.

      PoC: https://github.com/I-CAN-hack/secoc

      • Extracted the firmware from an ECU, using Fault Injection to bypass the locked debug port.
      • Reverse engineered the application code, to understand how SecOC was implemented and find the location of the keys in RAM.
      • Reverse engineered the bootloader, to understand how the update procedure works and how we can upload and run shellcode.
      • We built a shellcode that extracts the keys from RAM and sends them out over CAN, then reboots the device.
    • It is a long read, but it is exactly why this is such a hard problem and there are some serious hurdles to overcome when it comes to extracting the keys.
    • An incomplete exerpts of some other information:
      • There is a way to extract the SecOC key from the RAV4 Prime without disassembly.
      • During the construction of the payload, a secret key must have been extracted from the firmware in order to upload code to the EPS, run it, and extract the key. This isn't correct secure design but it lets third parties like comma.ai and I-CAN-hack to extract the key by uploading temporary code to the EPS to extract the key.
      • By not using the "Hardware Security Module" in the firmware, the key can be extracted from memory. Newer cars may use the HSM, which hides the key from memory, and getting the key out from those is an unsolved problem. What are the newer cars is unclear, but the 2023 Corolla Cross they looked at was using the HSM.
    • Some people are looking to get the key from their Rav4 Prime
  • Discord Followups on comma.ai Discord:

  • Willem: "Grab your SecOC key and share a route in #⁠toyota-security and I'll finish the car port for the RAV4 Prime!"

  • There is some discussion on whether it is possible to intercept the key during a re-keying process. (#general)

  • hdoublearp on Discord was able to retrieve their SECOC key with Willem's script.

  • hdoublearp report on his collaboration with Willem

    • "There is some progress on the port, thanks to Willem, lateral is working. Still some missing safety features, but the initial issues with the Prime’s new PCM messages are sorted out. Willem had to make some changes to account for gearing difference in the Prime compared to other models. I’ve sent my latest feedback and test scenarios to him, and will continue working with him on it.

    • hdoublearp posts a video. It is a video of an assisted lane change on a RAV4 Prime, a feature that does not exist on TSS2 but does in openpilot.

      2619375277588803360.mov
  • There is still work to figure out some of the new messages.

  • A second RAV4 Prime by @chrispypatt seems to have come online from Willem's work.

April 2024

May 2024

June 2024

July 2024

August 2024

September 2024

October 2024

November 2024

December 2024

January 2025

February 2025

March 2025

April 2025

May 2025

June 2025

July 2025

August 2025

September 2025

October 2025

November 2025

  • ggajoch discovers a reproducible issue where the EU Yaris Hybrid errors out when crossing over lane lines without the blinker on. It was not seen on the JP Yaris.
  • COMMA_CON 2025 is held in San Diego. Numerous interesting announcements are made:
    • comma releases the comma four. It is a radical redesign of the form factor and a lot of work needs to be done with regards to code working on these devices.

    • Toyota Security Comments: comma ai | COMMA CON 2025 | George Hotz | Outwit, Outplay, Outlast | President, an excerpt:

      [00:32:11.079 --> 00:32:13.079]   The ultimate comma
      [00:32:13.079 --> 00:32:16.079]   is not a device that plugs into your car.
      [00:32:16.400 --> 00:32:18.500]   It's a robot that gets in the driver's seat.
      [00:32:20.180 --> 00:32:21.279]   That's where we're going.
      [00:32:22.299 --> 00:32:23.160]   Why should we,
      [00:32:23.160 --> 00:32:31.200]   oh, you're going to crack the Toyota should we oh oh you gotta crack the toyota security oh no who cares build a robot that gets in the seat and grabs the wheel and
      [00:32:31.200 --> 00:32:38.240]   turns the wheel now don't do this tomorrow because it's not gonna work right having
      [00:32:38.240 --> 00:32:54.819]   accurate predictions about technology is super important if you want to know where to do investment. I wish VCs understood any concept of this. But yeah, OpenPilot is a general purpose robotics operating system.
      [00:32:54.819 --> 00:32:58.839]   OpenPilot, everyone always says, oh, comma, you're going to die if you don't partner with
      [00:32:58.839 --> 00:33:02.859]   car makers. Everyone's going to get security. Or, oh, my God, I don't care. I want to build
      [00:33:02.859 --> 00:33:11.960]   a robot. I want it to cook and clean for me. But like actually do this. Not build up some hype. In the same way Cruise told
      [00:33:12.599 --> 00:33:15.680]   you they were going to solve self-driving and wasted $10 billion, you're going to see
      [00:33:15.680 --> 00:33:19.700]   all the same stuff happen in humanoid robots. And guess who's going to be there to pick
      [00:33:19.700 --> 00:33:29.180]   up the pieces? Kama and Tesla. Same people who are there today. So, yeah. No, I mean, the Kama
      [00:33:29.180 --> 00:33:34.759]   9 is going to be that guy. Get your car. Is it compatible with my car? Yeah, bro. He sits
      [00:33:34.759 --> 00:33:39.599]   in the seat. All right. That's my talk. I'll take questions.
      
  • GON0822 says there was an issue with the traction control on his Yaris Hybrid.
  • kaizen asks and pings geohot if they could bring their unsupported 2023 NX to comma to reverse engineer. However, it's responded that comma never responds to such requests.

December 2025

January 2026

February 2026

March 2026

April 2026

May 2026

June 2026

July 2026

August 2026


Footnotes

  1. This is an image of the CAN BUS traffic on a RAV4 Prime. The "checksum" for the Lane Keep Assist messages are now very high in entropy, indicative of some sort of signing or encryption being used.

  2. gregjhogan stated that the first byte of a UDS firmware version is not a bootloader version. https://discord.com/channels/469524606043160576/905950538816978974/1273746993394487376

    The first byte returned when reading the firmware versions using UDS read data by id isn't part of the version number, it is how many applications are running on the ECU (for example if it has two cores, there may be a separate application running on each core) and it tells you how many you can extract from the rest of the data returned.

    2 3 4 5 6 7
  3. Speculated from TechInfo lookup. TechInfo lookup is looking at Toyota's Techinfo site (payment required, minimum ~$25) and seeing if replacing the "Object recognition camera" / "Forward recognition camera" requires an ECU Security Key update. https://discord.com/channels/469524606043160576/524327905937850394/894262224552624228 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

  4. As a shameless plug, do you like those real-time updating embedded values from the Google Spreadsheet up there for the bounty and vote tracker? I made cellshield.info for that and other non-security key related uses. Check it out and let me know outside of this discussion if you have any comments! 2 3

About

🔐 Documentation/News/History/Guide on openpilot with Toyota/Lexus/Subaru with TSK/ECU SECURITY KEY/SecOC

Resources

Stars

181 stars

Watchers

27 watching

Forks

Used by

Contributors