Skip to content
Leaked secrets Disclosed report Beginner

Sauce Labs API key unencrypted in an old commit

An API key for Sauce Labs was found in an old commit of a Travis CI configuration file, encoded but not encrypted. The key was still active, and the reporter believes it could give an attacker full control of the account.

trufflesecurity Follow

Originally disclosed on HackerOne

  • Disclosed after 3.2 years

Hey there,

I found an API key in an old copy of the Travis.yaml file which is encoded, not encrypted. It's available here https://github.com/rails/rails/blob/a9cb1968b6a01572a472a3df3aa750ebc022e076/.travis.yml#L32

This decodes to a key you can test as seen below:

curl https://rubyonrails:[email protected]/rest/v1/users/rubyonrails

which returns:

{"username": "rubyonrails", "vm_lockdown": false, "new_email": null, "last_name": null, "tunnels_lockdown": false, "parent": null, "team_management": true, "creation_time": 1462825877, "user_type": "floss (medium)", "monthly_minutes": {"manual": "infinite", "automated": "infinite"}, "prevent_emails": ["marketing"], "to_plan": null, "performance_enabled": false, "domain": null, "manual_minutes": "infinite", "can_run_manual": true, "concurrency_limit": {"mac": 15, "scout": 10, "overall": 10, "real_device": 0}, "is_public": true, "to_username": null, "id": "rubyonrails", "access_key": "a035343f-e922-40b3-aa3c-06b3ea635c48", "first_name": "Ruby on Rails", "verified": true, "name": null, "subscribed": false, "title": null, "ancestor_user_type": "floss (medium)", "terminating_subscription": false, "is_sso": false, "allow_integrations_page": true, "to_migration_status": null, "last_login": null, "ancestor_concurrency_limit": {"mac": 15, "scout": 10, "overall": 10, "real_device": 0}, "allowed_regions": ["us-west-1"], "require_full_name": false, "sso_alias": null, "ancestor": "rubyonrails", "minutes": "infinite", "email": "██████████", "to_migration_date": null}%

Indicating the key the key is still active.

Impact

At a glance I don't see any access controls on sauce labs, so I think this key might give an attacker full control of ████'s account.

I found the key using TruffleHog, which is an open source tool I wrote that finds secrets in source code

The original report as published on HackerOne, by trufflesecurity. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

The key could give an attacker full control of the Sauce Labs account, as the reporter saw no access controls.

What the attacker needed

Access to the public repository; the key remains active

How it was found

  1. Find the old commit containing the encoded API key.
  2. Decode the key.
  3. Use the decoded key to make an authenticated request to the Sauce Labs API.
  4. Observe that the request succeeds and returns account details.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A secret key was accidentally left in an old version of a configuration file on a public code repository. Even though the file was changed later, the old version is still accessible, and the key still works. Anyone who finds it could use it to access the service it belongs to.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More from Ruby on Rails

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.