🥅 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

@@ -646,7 +646,7 @@ class PluginManagerPlugin(
elif command == "uninstall":
plugin_name = data["plugin"]
if plugin_name not in self._plugin_manager.plugins:
return make_response("Unknown plugin: %s" % plugin_name, 404)
return make_response("Unknown plugin", 404)
plugin = self._plugin_manager.plugins[plugin_name]
return self.command_uninstall(plugin, cleanup=data.get("cleanup", False))
@@ -667,7 +667,7 @@ class PluginManagerPlugin(
elif command == "enable" or command == "disable":
plugin_name = data["plugin"]
if plugin_name not in self._plugin_manager.plugins:
return make_response("Unknown plugin: %s" % plugin_name, 404)
return make_response("Unknown plugin", 404)
plugin = self._plugin_manager.plugins[plugin_name]
return self.command_toggle(plugin, command)