Skip to content

Commit 8d4f9d7

Browse files
Add fuzzing assert to fuzz against CVE-2017-1000117
1 parent 19e1b7b commit 8d4f9d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gix-url/fuzz/fuzz_targets/parse.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ fn fuzz(data: &[u8]) -> Result<()> {
99
_ = black_box(url.user());
1010
_ = black_box(url.password());
1111
_ = black_box(url.password());
12-
_ = black_box(url.host_argument_safe());
12+
if let Some(safe_host) = black_box(url.host_argument_safe()) {
13+
// Ensure malicious host paths can't be returned see;
14+
// https://secure.phabricator.com/T12961
15+
assert!(!safe_host.starts_with("ssh://-"));
16+
}
1317
_ = black_box(url.path_argument_safe());
1418
_ = black_box(url.path_is_root());
1519
_ = black_box(url.port_or_default());

0 commit comments

Comments
 (0)