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

Fixes CVE-2019-13139 git ref cmd injection #360

Conversation

TomSweeneyRedHat
Copy link

Signed-off-by: TomSweeneyRedHat tsweeney@redhat.com

- What I did
Add a check to the git reference to validate that it did not have a leading dash '-' in front of it, allowing for a security injection. This is per CVE-2019-13139 and BZ https://bugzilla.redhat.com/show_bug.cgi?id=1733941

Corresponding change from upstream Docker: moby#38944

Fixed in Docker 1.13.1-rhel here: #359

- How I did it
Lots of vi and testing.

- How to verify it
Without the fix this is the way to reproduce the issue:

# rm -rf /tmp/docker-build-git* 
# docker build 'git://github.com/RedHatOfficial/openhardware#-btest-branch:test'  # ignore any errors
# cd /tmp/docker-build-git* 
# git branch 

With the error in play, there will be a master and a rogue test branch created, the test branch should not be there.

With the fix:

# rm -rf /tmp/docker-build-git* 
# docker build 'git://github.com/RedHatOfficial/openhardware#-btest-branch:test'  # ignore any errors
unable to prepare context: unable to 'git clone' to temporary context directory: invalid refspec: -btest-branch
# cd /tmp/docker-build-git* 
# git branch 

and only the master branch should be there.

- Description for the changelog

Addresses CVE-2019-13139 - docker: command injection due to a missing validation of the git ref command

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Sep 6, 2019

LGTM

@rhatdan rhatdan merged commit 474a284 into projectatomic:docker-1.13.1 Sep 6, 2019
@TomSweeneyRedHat TomSweeneyRedHat deleted the dev/tsweeney/gitcve-1.13.1 branch October 4, 2019 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants