These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.
Mercedes-Benz source code exposure
January 2024 · Fixed
A Mercedes-Benz employee pushed a working token for the company's internal GitHub Enterprise Server to a public GitHub repository, where it sat for almost four months and gave read access to internal source code and the credentials stored in it.
- Way in
- Leaked token
- Went after
- Read or expose private code
- Access held
- T3Contents: ReadCloud, database and API keys
Full summary
In late September 2023 a Mercedes-Benz employee published code to their own public repository on github.com, and the code contained a token for Mercedes' internal GitHub Enterprise Server. Nothing caught it. RedHunt Labs found it in a routine scan on 11 January 2024 and found it still worked. RedHunt says it gave unrestricted and unmonitored access to all the source code on the server, and that the repositories held database connection strings, cloud access keys, SSO passwords, API keys, blueprints and design documents; TechCrunch saw evidence of Azure and AWS keys and a Postgres database. Mercedes says the token reached a certain number of repositories, not all of them. Once TechCrunch told Mercedes on 22 January, it revoked the token and took the repository down within two days. Mercedes said customer data was not affected as far as its analysis showed, but would not say whether anyone else used the token in those four months or whether it had the logs to tell.
How it unfolded
Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.
Whole path
The whole attack, one row per step. Pick a step on the left, or click a box in its row.
On 29 September 2023 a full-time Mercedes-Benz employee pushed code to their own public repository on github.com. It contained a token for Mercedes' internal GitHub Enterprise Server. Mercedes later called it human error: "source code containing an internal access token was published on a public GitHub repository".
What breaks this step
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Secret scanning and push protection enabled
- Set `persist-credentials: false` on actions/checkout wherever later steps do not push
- Require organization owner approval for fine-grained PATs.
- Never upload the checkout workspace as an artifact.
On 11 January 2024, more than three months later, RedHunt Labs found the token during a routine scan of GitHub for leaked secrets. It still worked against the internal server.
RedHunt says the token gave "unrestricted" and "unmonitored" access to the entire source code on the Enterprise Server. Mercedes disputes the breadth and says it reached a certain number of repositories, not all of them. Neither side says what kind of token it was or which scopes it had.
According to RedHunt the repositories contained database connection strings, cloud access keys, SSO passwords, API keys, blueprints and design documents. TechCrunch saw evidence of Microsoft Azure and AWS keys and a Postgres database. BleepingComputer notes RedHunt had not validated the files' contents, so whether those keys worked is not known.
What breaks this step
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Audit and revoke stale PATs, unused SSH keys, and inactive accounts
- Enforce an IP allow list for Git and web UI access from trusted ranges
- Service-account automation migrated from PATs to GitHub Apps
RedHunt brought in TechCrunch on 15 January, and TechCrunch told Mercedes on 22 January. On 24 January Mercedes revoked the token and removed the public repository, and RedHunt confirmed the same day that the token no longer worked. The token had been public for almost four months.
TechCrunch reported the leak on 26 January and RedHunt published on 29 January. Mercedes said customer data was not affected as far as its analysis showed, but declined to say whether a third party had used the token or whether it had access logs. BleepingComputer points out that misuse would only show up if audit logging was on for the Enterprise Server.
Frameworks
Fixed. First seen January 2024. Mapping by ghtier, not yet reviewed. Threat landscape
Sources
- researchMercedes-Benz source code at risk: GitHub token mishap
- trackerMercedes-Benz source code exposure (Wiz cloud threat landscape)
- trackerHow a mistakenly published password exposed Mercedes-Benz source code
- trackerA mishandled GitHub token exposed Mercedes-Benz source code
- trackerLeaked GitHub token exposed Mercedes source code