Skip to content

Commit

Permalink
Replace '<' and '>' for swarm 'host' field. Fix for XSS attack.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhupfeldt committed Oct 22, 2020
1 parent dd14aac commit 0d11817
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def swarm():
spawn_rate = float(request.form["spawn_rate"])

if request.form.get("host"):
environment.host = str(request.form["host"])
# Replace < > to guard against XSS
environment.host = str(request.form["host"]).replace('<', '').replace('>', '')

if environment.shape_class:
environment.runner.start_shape()
Expand Down

0 comments on commit 0d11817

Please sign in to comment.