Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
danjac
· 4y ago · 0 comments
This code looks like it has an XSS vulnerability in the submit() method: returning plain f-string i.e.
return f"<tr> <td>{title}</td> <td>{author_name}</td> <td>...."
Probably safer (and more maintainable) to just return a Jinja2 template instead.
Comments
[–]
qatanah
4y ago
Something I've wanted to comment on this as well. It's best to use render_template() when rendering the views so it doesn't tangle w/ a lot of python controller logic.