mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
http: add --security-revert for CVE-2018-12116
PR-URL: https://github.com/nodejs-private/node-private/pull/146 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
35344e87bf
commit
dd20c0186f
2 files changed
+12
-3
No files matched your search
+10
-1
@@ -14,6 +14,8 @@ const OutgoingMessage = require('_http_outgoing').OutgoingMessage;
|
||||
const Agent = require('_http_agent');
|
||||
const Buffer = require('buffer').Buffer;
|
||||
|
||||
const REVERT_CVE_2018_12116 = process.REVERT_CVE_2018_12116;
|
||||
|
||||
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;
|
||||
|
||||
function ClientRequest(options, cb) {
|
||||
@@ -47,7 +49,14 @@ function ClientRequest(options, cb) {
|
||||
var path;
|
||||
if (options.path) {
|
||||
path = String(options.path);
|
||||
if (INVALID_PATH_REGEX.test(path))
|
||||
var invalidPath;
|
||||
if (REVERT_CVE_2018_12116) {
|
||||
invalidPath = /[\u0000-\u0020]/.test(path);
|
||||
} else {
|
||||
invalidPath = INVALID_PATH_REGEX.test(path);
|
||||
}
|
||||
|
||||
if (invalidPath)
|
||||
throw new TypeError('Request path contains unescaped characters');
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
**/
|
||||
namespace node {
|
||||
|
||||
#define SECURITY_REVERSIONS(XX)
|
||||
// XX(CVE_2016_PEND, "CVE-2016-PEND", "Vulnerability Title")
|
||||
#define SECURITY_REVERSIONS(XX) \
|
||||
XX(CVE_2018_12116, "CVE-2018-12116", "HTTP request splitting")
|
||||
|
||||
enum reversion {
|
||||
#define V(code, ...) SECURITY_REVERT_##code,
|
||||
|
||||
Reference in new issue
Block a user