Show More
@@ -1135,7 +1135,7 b' make sure we show changed files, rather ' | |||
|
1135 | 1135 | test for Git CVE-2016-3068 |
|
1136 | 1136 | $ hg init malicious-subrepository |
|
1137 | 1137 | $ cd malicious-subrepository |
|
1138 |
$ echo "s = [git]ext::sh -c echo% pwned% > |
|
|
1138 | $ echo "s = [git]ext::sh -c echo% pwned% >pwned.txt" > .hgsub | |
|
1139 | 1139 | $ git init s |
|
1140 | 1140 | Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/ |
|
1141 | 1141 | $ cd s |
@@ -1145,23 +1145,27 b' test for Git CVE-2016-3068' | |||
|
1145 | 1145 | $ hg add .hgsub |
|
1146 | 1146 | $ hg commit -m "add subrepo" |
|
1147 | 1147 | $ cd .. |
|
1148 | $ rm -f pwned.txt | |
|
1148 | 1149 | $ env -u GIT_ALLOW_PROTOCOL hg clone malicious-subrepository malicious-subrepository-protected |
|
1149 | 1150 | Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... (glob) |
|
1150 | 1151 | fatal: transport 'ext' not allowed |
|
1151 | 1152 | updating to branch default |
|
1152 |
cloning subrepo s from ext::sh -c echo% pwned% > |
|
|
1153 | cloning subrepo s from ext::sh -c echo% pwned% >pwned.txt | |
|
1153 | 1154 | abort: git clone error 128 in s (in subrepo s) |
|
1154 | 1155 | [255] |
|
1156 | $ test -f pwned.txt && cat pwned.txt || true | |
|
1155 | 1157 | |
|
1156 | 1158 | whitelisting of ext should be respected (that's the git submodule behaviour) |
|
1159 | $ rm -f pwned.txt | |
|
1157 | 1160 |
$ |
|
1158 | 1161 | Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... (glob) |
|
1159 | pwned | |
|
1160 | 1162 | fatal: Could not read from remote repository. |
|
1161 | 1163 | |
|
1162 | 1164 | Please make sure you have the correct access rights |
|
1163 | 1165 | and the repository exists. |
|
1164 | 1166 | updating to branch default |
|
1165 |
cloning subrepo s from ext::sh -c echo% pwned% > |
|
|
1167 | cloning subrepo s from ext::sh -c echo% pwned% >pwned.txt | |
|
1166 | 1168 | abort: git clone error 128 in s (in subrepo s) |
|
1167 | 1169 | [255] |
|
1170 | $ cat pwned.txt | |
|
1171 | pwned |
General Comments 0
You need to be logged in to leave comments.
Login now