Skip to content

Release v0.26.4 - #4666

Merged
ethomson merged 23 commits into
libgit2:maint/v0.26from
pks-t:pks/v0.26.4
Jun 4, 2018
Merged

Release v0.26.4#4666
ethomson merged 23 commits into
libgit2:maint/v0.26from
pks-t:pks/v0.26.4

Conversation

@pks-t

@pks-t pks-t commented Jun 1, 2018

Copy link
Copy Markdown
Member

Backport of v0.27.1 to maint/0.26. This is mainly intended as a help for objective-git, which is currently stalled due to libssh2 linking issues, but it might be useful to others, as well.

ethomson and others added 21 commits June 1, 2018 13:44
At present, we have three online tests against bitbucket: one which
specifies the credentials in the payload, one which specifies the
correct credentials in the URL and a final one that specifies the
incorrect credentials in the URL.  Bitbucket has begun responding to the
latter test with a 403, which causes us to fail.

Break these three tests into separate tests so that we can skip the
latter until this is resolved on Bitbucket's end or until we can change
the test to a different provider.
Update the settings to use a specific read-only token for accessing our
test repositories in Bitbucket.
We should pretend such submdules do not exist as it can lead to RCE.
If the we decide that the "name" of the submodule (i.e. its path inside
`.git/modules/`) is trying to escape that directory or otherwise trick us, we
ignore the configuration for that submodule.

This leaves us with a half-configured submodule when looking it up by path, but
it's the same result as if the configuration really were missing.

The name check is potentially more strict than it needs to be, but it lets us
re-use the check we're doing for the checkout. The function that encapsulates
this logic is ready to be exported but we don't want to do that in a security
release so it remains internal for now.
Otherwise we would also admit `..\..\foo\bar` as a valid path and fail to
protect Windows users.

Ideally we would check for both separators without the need for the copied
string, but this'll get us over the RCE.
This lets us check for other kinds of reserved files.
It checks against the 8.3 shortname variants, including the one which includes
the checksum as part of its name.
Given a path component it knows what to pass to the filesystem-specific
functions so we're protected even from trees which try to use the 8.3 naming
rules to get around us matching on the filename exactly.

The logic and test strings come from the equivalent git change.
These can't go into the public API yet as we don't want to introduce API or ABI
changes in a security release.
These will be used by the checkout code to detect them for the particular
filesystem they're on.
We want to reject these as they cause compatibility issues and can lead to git
writing to files outside of the repository.
We may take in names from the middle of a string so we want the caller to let us
know how long the path component is that we should be checking.
This is so we have it available for the path validity checking. In a later
commit we will start rejecting `.gitmodules` files as symlinks.
Any part of the library which asks the question can pass in the mode to have it
checked against `.gitmodules` being a symlink.

This is particularly relevant for adding entries to the index from the worktree
and for checking out files.
When dealing with `core.proectNTFS` and `core.protectHFS` we do check
against `.gitmodules` but we still have a failing test as the non-filesystem
codepath does not check for it.
We still compare case-insensitively to protect more thoroughly as we don't know
what specifics we'll see on the system and it's the behaviour from git.
We might modify caches due to us trying to load the configuration to figure out
what kinds of filesystem protections we should have.
@pks-t

pks-t commented Jun 1, 2018

Copy link
Copy Markdown
Member Author

Backported #4588 and #4584 to fix Bitbucket-specific tests

@ethomson

ethomson commented Jun 1, 2018

Copy link
Copy Markdown
Member

Your last two commit messages reference 0.27 still (though they correctly update the version number in the product). Otherwise I'm 👍

@pks-t

pks-t commented Jun 1, 2018

Copy link
Copy Markdown
Member Author

Oh, forgot to adjust the commit messages. Thanks for noticing.

@ethomson
ethomson merged commit ca55ada into libgit2:maint/v0.26 Jun 4, 2018
@ethomson

ethomson commented Jun 4, 2018

Copy link
Copy Markdown
Member

@pks-t do you want to do the honors of tagging, or should I?

@pks-t

pks-t commented Jun 4, 2018

Copy link
Copy Markdown
Member Author

I went ahead and tagget the release, thanks for merging. I would've done it a bit earlier, but I got a nice case of summer flu and today my ISP decided to turn off my internet access. Fun times :)

Please just have a quick look and verify whether the release looks good.

@pks-t
pks-t deleted the pks/v0.26.4 branch June 4, 2018 15:41
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.

3 participants