# Closing major security vulnerability, re branches?

**URL:** <https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429>\
**Category:** Deployments\
**Tags:** security\
**Created:** [November 9, 2018, 1:54pm UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429 "2018-11-09T13:54:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![luke\_grassroot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/luke_grassroot/32/19701_2.png) [@luke\_grassroot](https://discuss.circleci.com/u/luke_grassroot)\
**Post date:** [November 9, 2018, 1:54pm UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/1 "2018-11-09T13:54:12Z")

</div>

Hello,

Has anyone found a solution to the vulnerability that if, on a large team, you have protected your GitHub master branch a malicious dev can push a change to config.yml that forces deployment of their branch?

> [@Secure circle.yml file](https://discuss.circleci.com/t/secure-circle-yml-file/5277):
>
> Hi, Is there any we can secure the circle.yml file ? As of now, we would like to use circleci to auto deploy our build to the production servers. However, it seems that any developper can modify the circle.yml file (via a branch), build a malicious version and release that version to production. Thanks

It was posted a while back but Circle CI seems to have just closed it without responding. This was pointed out to us recently and frankly I’m not sure we can keep using Circle CI if there isn’t a fix - pretty easy to come up with scenarios where this allows a single dev just with dev branch permissions to push code to production that gives them full control. I’ve been searching for a way to, say, protect the filter section of the job definition to say it can only be changed on master, but not finding anything.

Anybody else had any luck?

Best  
Luke

---

<div class="post-metadata">

**Author:** ![nvanheuverzwijn](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nvanheuverzwijn/32/10744_2.png) [@nvanheuverzwijn](https://discuss.circleci.com/u/nvanheuverzwijn)\
**Post date:** [November 9, 2018, 2:28pm UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/2 "2018-11-09T14:28:27Z")

</div>

> [@luke\_grassroot](#):
>
> It was posted a while back but Circle CI seems to have just closed it without responding. This was pointed out to us recently and frankly I’m not sure we can keep using Circle CI if there isn’t a fix - pretty easy to come up with scenarios where this allows a single dev just with dev branch permissions to push code to production that gives them full control. I’ve been searching for a way to, say, protect the filter section of the job definition to say it can only be changed on master, but not finding anything.

There is not solution to this from what I can tell. Right now, I just trust the users but that is dangerous if you work with third party developpers on your github repository.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [November 10, 2018, 7:50pm UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/3 "2018-11-10T19:50:18Z")

</div>

> [@luke\_grassroot](#):
>
> [CircleCI] seems to have just closed it without responding

I don’t believe this is the case. This forum is powered by Discourse, which has an auto-lock setting. Threads are closed after a fixed period (three months) to prevent necroposting. It’s fine to create a new thread and link to the old one.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [November 10, 2018, 7:54pm UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/4 "2018-11-10T19:54:02Z")

</div>

> [@nvanheuverzwijn](#):
>
> that is dangerous if you work with third party developpers on your github repository.

True. I’ve not had to deal with this, but I wonder if the best solution is for third parties to replicate the build process in another CircleCI account, minus the deployment keys/capability.

I wonder, for companies that are particularly security-minded, they would insist on this anyway even if CircleCI did have provision for restricting changes to the config file - a clear separation of accounts would give confidence that a deployment key could not be used by a third party.

---

<div class="post-metadata">

**Author:** ![luke\_grassroot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/luke_grassroot/32/19701_2.png) [@luke\_grassroot](https://discuss.circleci.com/u/luke_grassroot)\
**Post date:** [November 11, 2018, 6:39am UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/5 "2018-11-11T06:39:59Z")

</div>

Ah, true re the closing period. I shouldn’t have assumed that’s the case without checking. Thanks for correcting.

Yes I’m thinking about some separation of accounts. Although then we’d possibly need to configure Circle CI to build different branches on different accounts, which I’m not sure is possible.

What we will probably need to do is switch to a tighter process of only allowing forks & PRs for every dev instead of branches and PRs within the repo (with the ‘don’t share env variables on fork builds’ on). Not entirely ideal and would really have liked the simple option of “don’t allow config changes off master”, but seems best way at present.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [November 11, 2018, 10:11am UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/6 "2018-11-11T10:11:24Z")

</div>

> [@luke\_grassroot](#):
>
> Although then we’d possibly need to configure Circle CI to build different branches on different accounts

I expect you can set a branch protection on master for the third-party GitHub account, so they can do everything but merge to master. Then, set up Context env vars for your team, containing your deploy keys - a third party account would not have these and so any deploy operation would fail.

Or you could get the third party to work on a fork rather than non-master branches.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [February 9, 2019, 10:17am UTC](https://discuss.circleci.com/t/closing-major-security-vulnerability-re-branches/26429/7 "2019-02-09T10:17:49Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
