diff options
author | RafaelGSS <rafael.nunu@hotmail.com> | 2022-07-13 19:20:22 +0300 |
---|---|---|
committer | RafaelGSS <rafael.nunu@hotmail.com> | 2022-09-23 18:32:45 +0300 |
commit | b358fb27a4253c6827378a64163448c04301e19c (patch) | |
tree | b90edd916d04c131f995bf1072f1050ab4abe4df /src | |
parent | eead3e9ac8d0eab4cae4eaa73c01f67fd1c78a3c (diff) |
src: fix IPv4 non routable validation
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/337
CVE-ID: CVE-2022-32212, CVE-2018-7160
Diffstat (limited to 'src')
-rw-r--r-- | src/inspector_socket.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 79b50e6a452..ab1cdf1fa5b 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -164,6 +164,7 @@ static std::string TrimPort(const std::string& host) { static bool IsIPAddress(const std::string& host) { if (host.length() >= 4 && host.front() == '[' && host.back() == ']') return true; + if (host.front() == '0') return false; uint_fast16_t accum = 0; uint_fast8_t quads = 0; bool empty = true; |