Code Room
Code reviewHardcr-g024
Subject XssLevel Senior–Staff~25 minCommon in Security interviewsIndustries Software development

Question

Review this Python (Jinja2) profile renderer used in a server-rendered app.

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.

Talk through your review
Code to reviewpython
from markupsafe import Markup def render_bio(user):    # bio is user-supplied markdown converted to HTML elsewhere    html = markdown_to_html(user.bio_md)    return Markup(        '<div class="bio">' + html + '</div>'    ) # template:  {{ render_bio(current_user_viewing) | safe }}
Run or narrate your approach, then ask the coach.