diff --git a/locust/web.py b/locust/web.py index 7790115984..f5bba1b225 100644 --- a/locust/web.py +++ b/locust/web.py @@ -355,8 +355,8 @@ def exceptions() -> Response: "exceptions": [ { "count": row["count"], - "msg": row["msg"], - "traceback": row["traceback"], + "msg": escape(row["msg"]), + "traceback": escape(row["traceback"]), "nodes": ", ".join(row["nodes"]), } for row in (environment.runner.exceptions.values() if environment.runner is not None else [])