net: Add regression fuzz harness for CVE-2017-18350. Add FuzzedSocket.#19203
net: Add regression fuzz harness for CVE-2017-18350. Add FuzzedSocket.#19203maflcko merged 2 commits intobitcoin:masterfrom
Conversation
|
Concept ACK |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
2a31e08 to
3c83df2
Compare
3c83df2 to
44157f4
Compare
44157f4 to
2a4d581
Compare
2a4d581 to
f28d7be
Compare
f28d7be to
4b17a6b
Compare
9002ce9 to
ff13f09
Compare
|
Code review ACK ff13f099c922b90b6952d896d948d713ef6e9f7d |
ad65949 to
88af030
Compare
|
@laanwj Thanks for the quick review! ❤️ Pushed an updated version addressing @MarcoFalke's feedback. Should hopefully be ready for final review. |
vasild
left a comment
There was a problem hiding this comment.
ACK 88af03002c170d95dc04077f3bbcd739e2a9e5b7
|
Running the new fuzz test for a few tens of minutes produces no errors. Reverting the fix for CVE-2017–18350 like this: --- i/src/netbase.cpp
+++ w/src/netbase.cpp
@@ -533,13 +533,13 @@ bool Socks5(const std::string& strDest, int port, const ProxyCredentials* auth,
case SOCKS5Atyp::DOMAINNAME:
{
recvr = InterruptibleRecv(pchRet3, 1, SOCKS5_RECV_TIMEOUT, sock);
if (recvr != IntrRecvError::OK) {
return error("Error reading from proxy");
}
- int nRecv = pchRet3[0];
+ int nRecv = (char)pchRet3[0];
recvr = InterruptibleRecv(pchRet3, nRecv, SOCKS5_RECV_TIMEOUT, sock);
break;
}
default: return error("Error: malformed proxy response");
}
if (recvr != IntrRecvError::OK) {crashes the test in less than a minute. |
|
The PR description needs an update since it mentions 4 commits, but there are just 2 now. |
Ah yes I had already updated the PR title for it, but you're right that the description is out of date too. |
ryanofsky
left a comment
There was a problem hiding this comment.
Code review ACK 88af03002c170d95dc04077f3bbcd739e2a9e5b7 with caveat that I don't know very much about fuzzing so ignore my suggestions.
d06d25c to
b62b90f
Compare
|
b62b90fa0e642c89a75afcfeb7f0491fc8e93f00 looks good except that the first commit does not compile: (the second commit fixes this) |
b62b90f to
366e3e1
Compare
Add regression fuzz harness for CVE-2017-18350. This fuzzing harness would have found CVE-2017-18350 within a minute of fuzzing :)
See
doc/fuzzing.mdfor information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the Bitcoin Core fuzzing corpus repo.Happy fuzzing :)