Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Variables are insecure and transferred to new repository owners #9430

Open
AWegnerGitHub opened this issue Apr 2, 2018 · 17 comments

Comments

@AWegnerGitHub
Copy link

If a GitHub repository is transferred to a new owner, all associated environment variables are transferred as well - including the "secure" ones.

Reproduction - Short Version

The short version is this:

  1. On one GitHub account, create a repository with a .travis.yml file
  2. On the Travis CI account associated with step 1, set up an environment variable and elect not to show the value in the build log
  3. Transfer the GitHub repository to another account.

At this point, the environment variables defined in step 2 are accessible by the new owner from step 3.


The longer version is that these "secure" variables aren't actually secure. Simple string manipulations can expose the variables in the build log and they are transferred to the new owner.

I've written a longer write up on this bug here. It was originally reported in December of 2017 to the security team, but multiple followups haven't been responded to. At this point, we're over three months since the initial report and I feel others need to know that their environment variables can be accessed if you transfer your repository or if you have a malicious commit applied to your build scripts, where you manipulate the build log string outputs to show the variable values.

@ArtOfCode-
Copy link

Is this likely to get a response from the Travis team at some point? It's a fairly niche vulnerability, to be entirely fair, but it's also a fairly serious security hole for those who are impacted but don't know it.

@Undo1
Copy link

Undo1 commented Jun 21, 2018

This is still an important issue - is there any timeline to getting this resolved, or at least acknowledged?

@redbeard
Copy link

@AWegnerGitHub -- could you validate my understanding that for this to be exploited it would require an attacker to transfer ownership of the original github repo with which the Travis CI build was configured?

@AWegnerGitHub
Copy link
Author

AWegnerGitHub commented Jun 26, 2018 via email

@Undo1
Copy link

Undo1 commented Jun 26, 2018

The threat model here isn't really an attacker (if an attacker gets into your GitHub account, it's all over anyway). The issue is that secrets can be inadvertently transferred with no indication or warning in the UI, and no way for the original owner to realize his secrets have been compromised until it's too late.

@stale
Copy link

stale bot commented Dec 17, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a new one after. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Dec 17, 2018
@BanzaiMan BanzaiMan removed the stale label Dec 17, 2018
@stale
Copy link

stale bot commented Mar 17, 2019

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a thread on the community forum. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Mar 17, 2019
@AWegnerGitHub
Copy link
Author

This is still labeled a security issue. I don't believe it should be closed before being fixed.

@stale stale bot removed the stale label Mar 17, 2019
@pathurs
Copy link

pathurs commented May 30, 2019

This security issue is easily exploited by "Social Hacking" (AKA "Social Engineering").

Party A is the owner of the GitHub Repository and, therefore, the Travis CI Project owner.
Party B is the "Social Hacker".

Party A has been working on an Open Source project for a fair while, has a very robust automated build process with Travis CI, including secure tokens to GitHub, and a few other third-party deploy targets. These tokens are kept secure using the Environment Variables settings in Travis CI.

Party B starts to contribute to this Open Source GitHub Repository, and over a few weeks to months, gains a small amount of trust from Party A. Party A decides to add Party B to their GitHub Repository "team", with write access.

Party A starts to get busy with other projects, and considers abandoning the Open Source GitHub Repository, however, Party B volunteers to maintain it instead. Party A agrees.

Party A transfers ownership of the GitHub repository to Party B.

Party B can now manipulate the .travis.yml file to print all Environment Variables by, for example, reversing the order of the string value of each Environment Variable.

Party B has now stolen secure tokens from Party A.

@angussidney
Copy link

angussidney commented Jul 11, 2019

Would it be possible to get an update on the status of your fix for this security vulnerability?

@piotr-travisci piotr-travisci self-assigned this Jul 18, 2019
@earonesty
Copy link

earonesty commented Sep 19, 2019

The trivial fix is to wipe secure vars then the owner changes hands. Seems the safe thing to do. It's like when you send a broken phone in for repairs ... you gotta back up your data and wipe the phone. Even if it's annoying... it's probably the best bet.

That's why they moved the factory data reset option into the main settings menu. Same thing for Travis.

As a nice to have... if someone really want to transfer secure env vars at the same time... add a checkbox or something that an owner can flip that's good for one insecure move.... and then gets flipped back.

@stale
Copy link

stale bot commented Dec 18, 2019

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a thread on the community forum. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Dec 18, 2019
@ArtOfCode-
Copy link

Bad bot. This is still a security issue. Confirmed security issues should not be closed, ever, until they're fixed.

@stale
Copy link

stale bot commented Mar 17, 2020

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a thread on the community forum. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Mar 17, 2020
@ArtOfCode-
Copy link

See above... again. @BanzaiMan @redbeard.

@stale stale bot removed the stale label Mar 18, 2020
@stale
Copy link

stale bot commented Jun 17, 2020

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a thread on the community forum. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Jun 17, 2020
@ArtOfCode-
Copy link

Bad bot. Bad. Go sit in the corner.

@stale stale bot removed the stale label Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants