Skip to content

Commit

Permalink
Merge pull request #11 from ch-rigu/main
Browse files Browse the repository at this point in the history
Fix for XSS vulnerability in the 'url' parameter in ombott/error_render.py when an error is rendered
  • Loading branch information
valq7711 authored Apr 13, 2024
2 parents a7f64e7 + 4b930d7 commit 75d5929
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ombott/error_render.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from pathlib import Path
import html as sanitize_html

html = Path(__file__).parent / 'error.html'

_html_lns = []

def render(err_resp, url, debug):
clean_url = sanitize_html.escape(url)
ex = traceback = '-] Forbidden [-'
if debug:
traceback = err_resp.traceback
Expand All @@ -17,7 +19,7 @@ def render(err_resp, url, debug):
e = err_resp,
exception = ex,
traceback = traceback,
url = repr(url)
url = repr(clean_url)
)

if not _html_lns:
Expand Down

1 comment on commit 75d5929

@mdipierro
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.