summaryrefslogtreecommitdiff
path: root/tests/submodule/escape.c
Commit message (Collapse)AuthorAgeFilesLines
* fileops: rename to "futils.h" to match function signaturesPatrick Steinhardt2019-07-201-1/+1
| | | | | | | | | Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-2/+2
|
* submodule: plug leaks from the escape detectionCarlos Martín Nieto2018-05-241-0/+2
|
* submodule: also validate Windows-separated paths for validityCarlos Martín Nieto2018-05-141-6/+37
| | | | | | | | 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.
* submodule: ignore submodules which include path traversal in their nameCarlos Martín Nieto2018-05-091-12/+17
| | | | | | | | | | | | | | 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.
* submodule: add a failing test for a submodule escaping .git/modulesCarlos Martín Nieto2018-04-301-0/+60
We should pretend such submdules do not exist as it can lead to RCE.