system: You are an expert security code reviewer. You will be shown a source code file along with a multi-select question listing several CWE (Common Weakness Enumeration) categories. Your task is to identify which of the listed CWEs are present in the code.

OUTPUT FORMAT: Respond with the letter(s) of all correct options, sorted alphabetically and comma-separated, wrapped in a single \boxed{...}. Examples: `\boxed{A}` for one correct, `\boxed{A,C}` for two, `\boxed{A,C,E}` for three. Output the boxed answer ONLY -- no explanation, no other text.

user: ```python
import json
import logging
import re
import webapp2
from models import Watcher

EMAIL_RE = re.compile(r'[^@]+@[^@]+\.[^@]+')

active_terms = [{'code': t[0], 'name': t[1]}
                for t in [
                    (1164, 'Summer Intersession 2016'),
                    (1166, 'Summer 2016'),
                    (1167, 'Fall Intersession 2016'),
                    (1169, 'Fall 2016')
                    ]]


class AppHandler(webapp2.RequestHandler):

    def watch(self):
        req = json.loads(self.request.body)
        email = str(req.get('email', ''))
        class_num = str(req.get('course', ''))
        term = str(req.get('term', ''))
        if (EMAIL_RE.match(email) is None or
                not email.endswith('uark.edu')):
            logging.warning('Email invalid: {}'.format(email))
            self.write_json({'message': 'Invalid @uark email.'}, 400)
            return
        if (not class_num.isdigit()
                or int(class_num) < 1 or int(class_num) > 100000):
            logging.warning('Course number invalid: {}'.format(class_num))
            self.write_json({'message': 'Invalid course number.'}, 400)
            return
        if (not term.isdigit()
                or not any(t['code'] == int(term) for t in active_terms)):
            logging.warning('Term code not invalid: {}'.format(term))
            self.write_json({'message': 'Invalid term number.'}, 400)
            return
        watcher = Watcher(email=email.lower(),
                          class_num=int(class_num), strm=int(term))
        watcher.put()
        self.write_json()

    def terms(self):
        self.write_json(active_terms)

    def write_json(self, response={}, status=200):
        self.response.headers['Content-Type'] = 'application/json'
        self.response.set_status(status)
        self.response.out.write(json.dumps(response))


app = webapp2.WSGIApplication([
    webapp2.Route(r'/cron/check', methods=['GET'],
                  handler='cron.CronHandler:check'),
    webapp2.Route(r'/cron/process', methods=['POST'],
                  handler='cron.CronHandler:process'),
    webapp2.Route(r'/watch', methods=['POST'],
                  handler='handlers.AppHandler:watch'),
    webapp2.Route(r'/terms', methods=['GET'],
                  handler='handlers.AppHandler:terms'),
])

```

Which of the following CWE vulnerability categories are present in this code? Multiple options may be correct.

  A) CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
  B) CWE-209: Generation of Error Message Containing Sensitive Information
  C) CWE-377: Insecure Temporary File
  D) CWE-20: Improper Input Validation
  E) CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection')
  F) CWE-614: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute
Answer: D