🥅 Don't return input params in error messages

While we always escape errors in the frontend, other clients or plugins
might not and thus this could cause XSS issues.
This commit is contained in:
Gina Häußge committed 2021-03-09 14:47:43 +01:00
1 parent 07c1d53a44
commit a441e48906
13 files changed
+103 -193

No files matched your search

+3 -5
View File
@@ -111,7 +111,7 @@ def retrieveSystemCommandsForSource(source):
elif source == "custom":
specs = _get_custom_command_specs()
else:
return make_response("Unknown system command source: {}".format(source), 404)
return make_response("Unknown system command source", 404)
return jsonify(_to_client_specs(specs))
@@ -127,13 +127,11 @@ def executeSystemCommand(source, command):
command_spec = _get_command_spec(source, command)
if not command_spec:
return make_response("Command {}:{} not found".format(source, command), 404)
return make_response("Command not found", 404)
if "command" not in command_spec:
return make_response(
"Command {}:{} does not define a command to execute, can't proceed".format(
source, command
),
"Command does not define a command to execute, can't proceed",
500,
)