Skip to content

Conversation

@adelton
Copy link
Contributor

@adelton adelton commented Oct 31, 2022

By default, protocol.file.allow now defaults to user, preventing clones with symlinks.

https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253

Starting off with this proposal to see what approach would be deemed the best.

@adelton
Copy link
Contributor Author

adelton commented Nov 5, 2022

@adelton
Copy link
Contributor Author

adelton commented Nov 5, 2022

Adding this proposed patch made Fedora package build: https://koji.fedoraproject.org/koji/buildinfo?buildID=2084874

@coolo
Copy link

coolo commented Dec 3, 2022

Thanks for the fix, picked it up for openSUSE

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Dec 3, 2022
https://build.opensuse.org/request/show/1039783
by user coolo + dimstar_suse
- Add fix from book/Git-Repository#22 to work
  around git 2.38.1's new default behaviour (22.patch)
@eserte
Copy link

eserte commented Jan 25, 2023

As older git versions may be patched, too (e.g. git 2.25.1 found in Ubuntu 20.04 also does not allow file protocol by default) I think it's best to make the configuration change unconditional without a git version check.

@eserte
Copy link

eserte commented Jan 25, 2023

See eserte@e957384 for an alternative patch.

@ap
Copy link
Contributor

ap commented Jan 25, 2023

Tl;dr: a check for either 2.12.0 or 1.7.2 makes the most sense, though no check at all also makes some sense; whereas a check for 2.38.1 is not a good idea.

Older git versions may be patched, too

That, plus (to spell this out explicitly) the fact the configuration override has no deleterious effect even if passed to an older Git which doesn’t have the 2.38.1 change of default. So there is a good reason to omit the check for 2.38.1, and no real reason reason to include it. (I would however add a comment to explain why the override is there, and that would mention 2.38.1.)

If there was to be a version check, it would make more sense to check for a version of Git which supports protocol.<name>.allow, which was added in git/git@f1762d7 and therefore first released in 2.12.0. Personally I think I would put a check for this particular version. However, again, it isn’t strictly necessary, because passing an unknown configuration option simply does nothing.

More strictly relevant might be that -c itself has not always been a supported switch in git: it was added in git/git@8b1fa77 and therefore first released in 1.7.2. Prior to that, any attempt to use git -c just yields “Unknown option: -c” and exit status 129.

hakonhagland added a commit to hakonhagland/Git-Repository that referenced this pull request Sep 28, 2024
Refer to PR book#22 and book#23 for details
@toddr
Copy link

toddr commented May 21, 2025

Fixes failures on t/21-submodule.t

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.

5 participants