From 9b7dfff4b1a5a3bde672264e61b5be7dd0850f0d Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 28 Jun 2021 12:49:50 -0700 Subject: [PATCH] Check for invalid certificate name. --- meshcentral.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meshcentral.js b/meshcentral.js index c008a3fc..da8e3e5f 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -182,6 +182,9 @@ function CreateMeshCentralServer(config, args) { return; } + // Check for invalid cert name + if ((obj.args.cert != null) && ((typeof obj.args.cert != "string") || (obj.args.cert.indexOf('@') >= 0) || (obj.args.cert.indexOf('/') >= 0) || (obj.args.cert.indexOf(':') >= 0))) { console.log("Invalid certificate name"); process.exit(); return; } + // Perform a password hash if (obj.args.hashpassword) { require('./pass').hash(obj.args.hashpassword, function (err, salt, hash, tag) { console.log(salt + ',' + hash); process.exit(); }); return; }