Skip to main content
Back to challenges

Web Security · Capture the flag

SSTI to RCE

Advanced · 4/5
Paid planSpecialist rank required130 points on first solo solve

Challenge brief

A Flask application uses Jinja2 templates unsafely. Exploit SSTI to read /etc/flag.

Vulnerable Code

@app.route('/hello')
def hello():
    name = request.args.get('name', 'World')
    template = f"Hello {name}!"
    return render_template_string(template)

Test

/hello?name={{7*7}} returns "Hello 49!"

Craft a payload to read the flag file.

Solo practice

Sign in to submit an answer and save your progress.

Sign in to practice