system: You are an expert security code reviewer. You will be shown a source code file along with a catalog of candidate CWE (Common Weakness Enumeration) categories with their official MITRE names. Your task is to list every distinct CWE from that catalog that is actually present in the code. The catalog is comprehensive for this dataset -- the answer is a (possibly small) subset of it.

OUTPUT FORMAT: Respond with a comma-separated list of CWE IDs in the form `CWE-N`, sorted in ascending numeric order, wrapped in a single \boxed{...}. Examples: `\boxed{CWE-79}` for one, `\boxed{CWE-22,CWE-79,CWE-327}` for three. Output the boxed answer ONLY -- no explanation, no other text.

user: ```python
from flask import render_template, url_for, flash, redirect,request
from flaskblog import app,db,bcrypt
from flaskblog.forms import *
from flaskblog.models import User, Complaint
from flask_login import login_user,current_user,logout_user,login_required
from flask_datepicker import datepicker
import os

@app.route("/home")
@login_required
def home():
    return render_template('home.html')

@app.route("/", methods=['GET', 'POST'])
def login():
    form = LoginForm()
    if form.validate_on_submit():
        user=User.query.filter_by(email=form.email.data).first()
        if user and bcrypt.check_password_hash(user.password,form.password.data):
            login_user(user)
            flash(f'You are logged in','success')
            next_page = request.args.get('next')
            return redirect(next_page) if next_page else redirect(url_for('home'))
        else:
            flash(f'Login Unsuccessful. Please check email and password','danger')
    return render_template('login.html', title='Login', form=form)

@app.route("/adminlogin", methods=['GET', 'POST'])
def adminlogin():

    form = AdminLoginForm()
    if form.validate_on_submit():
        user=User.query.filter_by(email=form.email.data).first()
        if user and bcrypt.check_password_hash(user.password,form.password.data):
            login_user(user)
            if(current_user.username=='admin'):
                flash(f'You are logged in as ADMIN','success')
                return redirect(url_for('showcomplaints'))
            else:
                flash(f'You\'re not an admin,Switch to User login','danger')
        else:
            flash(f'Login Unsuccessful. Please check email and password','danger')
    return render_template('adminlogin.html', title='Login', form=form)




@app.route("/complaint",methods=['GET','POST'])
@login_required
def complaint():
    if(current_user.username=='admin'):
        flash(f'Login From a user account to register complaint','danger')
        return(redirect(url_for('showcomplaints')))

    else:

        form=ComplaintForm()
        if  form.validate_on_submit():
                complaint=Complaint(complainant = form.complainant.data,
                victim=form.victim.data,
                victph=form.victph.data,
                compph = form.compph.data,
                doc=form.doc.data,
                accused=form.accused.data,
                description=form.description.data,
                sections=form.sections.data,
                compadd=form.compadd.data,
                victadd=form.victadd.data,
                author=current_user)
                db.session.add(complaint)
                db.session.commit()
                flash(f'Your complaint has been registered. You will be contacted by our officer shortly.','success')
                return redirect(url_for('about'))
        return render_template('complaint.html',title='Complaint Registration',form=form)



@app.route("/about")
@login_required
def about():
    return render_template('about.html', title='About')


@app.route("/register", methods=['GET', 'POST'])
def register():
    if current_user.is_authenticated:
        flash('You are already logged in', 'success')
        return redirect(url_for('home'))
    form = RegistrationForm()
    if form.validate_on_submit():
        hashed_password=bcrypt.generate_password_hash(form.password.data).decode('utf-8')
        user=User(username=form.username.data,email=form.email.data,password=hashed_password)
        db.session.add(user)
        db.session.commit()
        flash(f'Your account has been created!', 'success')
        return redirect(url_for('login'))
    return render_template('register.html', title='Register', form=form)


@app.route("/logout")
def logout():
    logout_user()
    return redirect(url_for('login'))

@app.route('/showcomplaints',methods=['GET', 'POST'])
@login_required
def showcomplaints():
    print(current_user)
    if(current_user.username=='admin'):
            complaints=Complaint.query.all()
            if complaints==[]:
                flash(f"No Active  Complaints", "danger")

            return render_template('showcomplaints.html', title='Registered  Complaints',complaints=complaints)
    else:
        flash(f'This page is for admins only', 'danger')
        return(redirect(url_for('about')))
    
@app.route('/updatecomplaint<int:complaint_id>',methods=['GET', 'POST'])
@login_required
def updatecomplaint(complaint_id):
    if(current_user.username=='admin'):
        complaint=Complaint.query.get_or_404(complaint_id)
        form=ComplaintForm()
        if form.validate_on_submit():
            complaint.complainant=form.complainant.data
            complaint.victim=form.victim.data
            complaint.victph=form.victph.data
            complaint.compph = form.compph.data
            complaint.doc=form.doc.data
            complaint.accused=form.accused.data
            complaint.description=form.description.data
            complaint.sections=form.sections.data
            db.session.commit()
            flash('Your complaint has been updated!', 'success')
            return redirect(url_for('showcomplaints'))
        elif request.method == 'GET':
            form.complainant.data= complaint.complainant
            form.victim.data=complaint.victim
            form.victph.data=complaint.victph
            form.compph.data=complaint.compph 
            form.doc.data=complaint.doc
            form.accused.data=complaint.accused
            form.description.data=complaint.description
            form.sections.data=complaint.sections
            return render_template('updatecomplaint.html', title='Update  Complaint',form=form)
    else:
            flash(f"The page you're trying to access  is for admins only",'danger')
            return(redirect(url_for('about')))

@app.route('/deletecomplaint<int:complaint_id>',methods=['GET', 'POST'])
@login_required
def delete_complaint(complaint_id):
    if(current_user.username=='admin'):
        complaint=Complaint.query.get_or_404(complaint_id)
        db.session.delete(complaint)
        db.session.commit()
        flash('Your complaint has been deleted!', 'success')
        return redirect(url_for('showcomplaints'))


@app.route('/mycomplaints',methods=['GET','POST'])
@login_required
def mycomplaints():
    complaints=Complaint.query.filter_by(user_id=current_user.id)
    if(current_user.username=='admin'):
         flash(f"Login from user account for this page",'success')
         return(redirect(url_for('showcomplaints')))
    elif complaints==[]:
        flash(f"No Active  Complaints", "danger")
    else:
        return render_template('mycomplaints.html', title='Registered  Complaints',complaints=complaints)
```

Candidate CWE catalog (every CWE that appears anywhere in this dataset):
  - CWE-20: Improper Input Validation
  - CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  - CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
  - CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
  - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  - CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
  - CWE-94: Improper Control of Generation of Code ('Code Injection')
  - CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
  - CWE-116: Improper Encoding or Escaping of Output
  - CWE-117: Improper Output Neutralization for Logs
  - CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  - CWE-209: Generation of Error Message Containing Sensitive Information
  - CWE-215: Insertion of Sensitive Information Into Debugging Code
  - CWE-295: Improper Certificate Validation
  - CWE-312: Cleartext Storage of Sensitive Information
  - CWE-326: Inadequate Encryption Strength
  - CWE-327: Use of a Broken or Risky Cryptographic Algorithm
  - CWE-377: Insecure Temporary File
  - CWE-502: Deserialization of Untrusted Data
  - CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
  - CWE-611: Improper Restriction of XML External Entity Reference
  - CWE-614: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute
  - CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection')
  - CWE-730: OWASP Top Ten 2004 Category A9 - Denial of Service
  - CWE-732: Incorrect Permission Assignment for Critical Resource
  - CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
  - CWE-918: Server-Side Request Forgery (SSRF)
  - CWE-943: Improper Neutralization of Special Elements in Data Query Logic
  - CWE-1004: Sensitive Cookie Without 'HttpOnly' Flag
  - CWE-1333: Inefficient Regular Expression Complexity

List every distinct CWE from the catalog above that is actually present in this code.
Answer: CWE-601