Code RoomTemplate string renders user input
HardPrep Room Coding #2186

Template string renders user input

Code reviewSecuritySenior–Staff~22 min

Review this Python Flask endpoint that renders a personalized greeting.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.

0:00 of about 22 min
Mark a line and say what kind of problem it is.0 findings
1from flask import request, render_template_string
2 
3@app.route('/hello')
4def hello():
5 name = request.args.get('name', 'there')
6 template = f"<h1>Hello {name}!</h1>"
7 return render_template_string(template)
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.