Site icon API Security Blog

Unpatched Travis CI API Bug Exposes Thousands of Secret User Access Tokens

[![Travis CI API Bug](https://thehackernews.com/new-images/img/b/R29vZ2xl/AVvXsEgp2VVOoL0d6WO220TeNCMD7vtgw0kmrgv4p651kJflXZ09DLP7L0RKn7nVK9yz_yaKekjF4WXYth3um80JEbmvrvLUZUxl491cbSk7h53eW2NYejPcDaq_1QQHpQJI5nLtzH-9pqwztAERmyRQ7IhRYHdHk3uo7TyxP0QO99CmqeXsozE_OOwoAV15/s728-e1000/GITHUB.jpg)]()

An unpatched security issue in the Travis CI API has left tens of thousands of developers’ user tokens exposed to potential attacks, effectively allowing threat actors to breach cloud infrastructures, make unauthorized code changes, and initiate supply chain attacks.

“More than 770 million logs of free tier users are available, from which you can easily extract tokens, secrets, and other credentials associated with popular cloud service providers such as GitHub, AWS, and Docker Hub,” researchers from cloud security firm Aqua [said]() in a Monday report.

Travis CI is a [continuous integration]() service used to build and test software projects hosted on cloud repository platforms such as GitHub and Bitbucket.

The issue, previously reported in 2015 and [2019](), is rooted in the fact that the [API]() permits access to historical logs in cleartext format, enabling a malicious party to even “fetch the logs that were previously unavailable via the API.”

The logs go all the way back to January 2013 and up until May 2022, ranging from log numbers 4,280,000 to 774,807,924, which are used to retrieve a unique cleartext log through the API.

What’s more, further analysis of 20,000 logs revealed as many as 73,000 tokens, access keys, and other credentials associated with various cloud services like GitHub, AWS, and Docker Hub.

[![User Access Tokens](https://thehackernews.com/new-images/img/b/R29vZ2xl/AVvXsEi37reb94v2Il1yHjQ1j-YZ5F_6pWwfCcNid-z9a85mNEpfAIQ659ZzrAGFaXcueHWz_7MdOecK5aTE7ln20fDPcvZ0Df-s51A5QuliQAtHHSTRLDbMx-RhFKWOL-qZuU_-YFevrztGJb6DN5GmzmzP_xlsW8CEf-iiicaVOWPfp0J_Bfw0pgrUBktw/s728-e1000/tokens.jpg)]()

This is despite Travis CI’s attempts to [rate-limit the API]() and [automatically filter out]() secure environment variables and tokens from build logs by displaying the string “[secure]” in their place.

One of the critical insights is that while “github_token” was obfuscated, 20 other variations of this token that followed a different naming convention — including github_secret, gh_token, github_api_key, and github_secret — weren’t masked by Travis CI.

“Travis CI slowed down the velocity of API calls, which hinders the ability to query the API,” the researchers said. “In this case however, this was not enough. A skilled threat actor can find a workaround to bypass this.”

“However, combining the ease of accessing the logs via the API, incomplete censoring, accessing ‘restricted’ logs, and a weak process for rate limiting and blocking access to the API, coupled with a large number of potentially exposed logs, results in a critical situation.”

Travis CI, in response to the findings, has said the issue is “by design,” necessitating that users follow best practices to avoid leaking secrets in build logs and periodically rotate tokens and secrets.

The findings are particularly significant in the wake of an [April 2022 attack campaign]() that leveraged stolen OAuth user tokens issued to Heroku and Travis CI to escalate access to NPM infrastructure and clone select private repositories.

Found this article interesting? Follow THN on [Facebook](), [Twitter _?_]() and [LinkedIn]() to read more exclusive content we post.Read More

Exit mobile version