From 73021645d1d1fa0e851bae7e003982f9ee491e84 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 17 Jun 2019 21:07:41 +0200 Subject: [HTTP API] T1431: disallow empty config paths. --- src/services/vyos-http-api-server | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server index 834c06b4d..e11eb6d52 100755 --- a/src/services/vyos-http-api-server +++ b/src/services/vyos-http-api-server @@ -119,6 +119,9 @@ def configure(): op = c['op'] path = c['path'] + if not path: + raise ConfigSessionError("Malformed command \"{0}\": empty path".format(json.dumps(c))) + # Type checking if not isinstance(path, list): raise ConfigSessionError("Malformed command \"{0}\": \"path\" field must be a list".format(json.dumps(c))) -- cgit v1.2.3