| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3af0c25 commit 7a4f5dc
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,6 +151,8 @@ class Repo: | |||
| 151 | 151 | "-c", | |
| 152 | 152 | # Can install hooks that execute during clone: | |
| 153 | 153 | "--template", | |
| 154 | + # Fetches from a caller-controlled URL: | ||
| 155 | + "--bundle-uri", | ||
| 154 | 156 | ] | |
| 155 | 157 | """Options to :manpage:`git-clone(1)` that allow arbitrary commands to be executed. | |
| 156 | 158 | ||
@@ -172,6 +174,10 @@ class Repo: | |||
| 172 | 174 | # Writes output to a caller-controlled filesystem path. | |
| 173 | 175 | "--output", | |
| 174 | 176 | "-o", | |
| 177 | + # Reads from a caller-controlled filesystem path: | ||
| 178 | + "--add-file", | ||
| 179 | + # Injects a caller-controlled path and contents: | ||
| 180 | + "--add-virtual-file", | ||
| 175 | 181 | ] | |
| 176 | 182 | ||
| 177 | 183 | unsafe_git_revision_options = [ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -132,6 +132,7 @@ def test_clone_unsafe_options(self, rw_repo): | |||
| 132 | 132 | "-cprotocol.ext.allow=always", | |
| 133 | 133 | "-vcprotocol.ext.allow=always", | |
| 134 | 134 | f"--template={tmp_dir}", | |
| 135 | + f"--bundle-uri=file://{tmp_dir}", | ||
| 135 | 136 | ] | |
| 136 | 137 | for unsafe_option in unsafe_options: | |
| 137 | 138 | with self.assertRaises(UnsafeOptionError): | |
@@ -147,6 +148,7 @@ def test_clone_unsafe_options(self, rw_repo): | |||
| 147 | 148 | {"conf": "protocol.ext.allow=always"}, | |
| 148 | 149 | {"c": "protocol.ext.allow=always"}, | |
| 149 | 150 | {"template": tmp_dir}, | |
| 151 | + {"bundle_uri": f"file://{tmp_dir}"}, | ||
| 150 | 152 | ] | |
| 151 | 153 | for unsafe_option in unsafe_options: | |
| 152 | 154 | with self.assertRaises(UnsafeOptionError): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -433,6 +433,10 @@ def test_archive_rejects_unsafe_options(self): | |||
| 433 | 433 | with self.assertRaises(UnsafeOptionError): | |
| 434 | 434 | self.rorepo.archive(io.BytesIO(), "0.1.6", output=output_marker) | |
| 435 | 435 | assert not osp.exists(output_marker) | |
| 436 | + with self.assertRaises(UnsafeOptionError): | ||
| 437 | + self.rorepo.archive(io.BytesIO(), "0.1.6", add_file=output_marker) | ||
| 438 | + with self.assertRaises(UnsafeOptionError): | ||
| 439 | + self.rorepo.archive(io.BytesIO(), "0.1.6", add_virtual_file="file:content") | ||
| 436 | 440 | ||
| 437 | 441 | def test_archive_rejects_unsafe_remote_protocol(self): | |
| 438 | 442 | with tempfile.TemporaryDirectory() as tdir: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments