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
import re

import six

from .compat \
    import \
        izip_longest
from .errors \
    import \
        InvalidVersion
from .version \
    import \
        Version

_EPOCH_RE = re.compile("\d")

_UPSTREAM_VERSION_RE = re.compile("\d[a-zA-Z0-9.+-:~]*")

_DEBIAN_REVISION_RE = re.compile("[a-zA-Z0-9+.~]+")

_DIGITS_NO_DIGITS_RE = re.compile("(\d*)(\D*)")

def _compute_comparable():
    comparable = dict((c, ord(c)) for c in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
    comparable["~"] = -1
    comparable[""] = 0
    for k in ".+-:":
        comparable[k] = ord(k) + 256
    return comparable

_COMPARABLE = _compute_comparable()

def parse_version_string(version):
    epoch = None
    revision = None

    if ":" in version:
        epoch, version = version.split(":", 1)
    if "-" in version:
        version, revision = version.split("-", 1)

    if epoch is not None and not _EPOCH_RE.match(epoch):
        raise InvalidVersion("Invalid epoch for debian version: '%s'" % epoch)
    if not _UPSTREAM_VERSION_RE.match(version):
        raise InvalidVersion("Invalid upstream version for debian version: '%s'" % version)
    if revision is not None and not _DEBIAN_REVISION_RE.match(revision):
        raise InvalidVersion("Invalid debian revision for debian version: '%s'" % revision)

    return epoch, version, revision

def is_valid_debian_version(version):
    """
    Return True if the given version is a valid debian version
    """
    try:
        parse_version_string(version)
        return True
    except InvalidVersion:
        return False

if six.PY3:
    def _cmp(x, y):
        return (x > y) - (x < y)
else:
    _cmp = cmp

def _compare_part(left, right):
    """
    Compare two version strings according to the Debian comparison algorithm.

    Parameters
    ----------
    left: str
    right: str
        left and right version parts. A part must be either an upstream version
        or a debian revision

    Returns
    -------
    ret: int
        -1, 0 or 1 depending on the result of the comparison
    """
    left_parts = _DIGITS_NO_DIGITS_RE.split(left)
    right_parts = _DIGITS_NO_DIGITS_RE.split(right)

    for left_part, right_part in izip_longest(left_parts, right_parts, fillvalue=""):
        try:
            left_part, right_part = int(left_part), int(right_part)
        except ValueError:
            for left_part_c, right_part_c in izip_longest(left_part, right_part, fillvalue=""):
                st = _cmp(_COMPARABLE[left_part_c], _COMPARABLE[right_part_c])
                if st != 0:
                    return st
        else:
            st = _cmp(left_part, right_part)
            if st != 0:
                return st
    return 0

class ComparablePart(object):
    def __init__(self, version):
        self._version = version

    def __eq__(self, other):
        if isinstance(other, ComparablePart):
            return _compare_part(self._version, other._version) == 0
        else:
            return NotImplemented

    def __lt__(self, other):
        if isinstance(other, ComparablePart):
            return _compare_part(self._version, other._version) == -1
        else:
            return NotImplemented

    def __cmp__(self, other):
        if isinstance(other, ComparablePart):
            return _compare_part(self._version, other._version)
        else:
            return NotImplemented

class DebianVersion(Version):
    @classmethod
    def from_string(cls, version):
        epoch, upstream, revision = parse_version_string(version)
        return cls(upstream, revision, epoch)

    def __init__(self, upstream, revision=None, epoch=None):
        self.upstream = upstream
        self.revision = revision
        self.epoch = epoch

        comparable_parts = []
        if epoch is None:
            comparable_parts.append(0)
        else:
            comparable_parts.append(int(epoch))
        comparable_parts.append(ComparablePart(upstream))
        if revision is None:
            comparable_parts.append(ComparablePart("0"))
        else:
            comparable_parts.append(ComparablePart(revision))
        self._comparable_parts = comparable_parts

    def __str__(self):
        s = self.upstream
        if self.epoch:
            s = self.epoch + ":" + s
        if self.revision:
            s += "-" + self.revision
        return s

    def __hash__(self):
        return hash(str(self))

    def __cmp__(self, other):
        if isinstance(other, DebianVersion):
            return cmp(self._comparable_parts, other._comparable_parts)
        else:
            return NotImplemented

    def __eq__(self, other):
        if isinstance(other, DebianVersion):
            return self._comparable_parts == other._comparable_parts
        else:
            return NotImplemented

    def __lt__(self, other):
        if isinstance(other, DebianVersion):
            return self._comparable_parts < other._comparable_parts
        else:
            return NotImplemented

if six.PY3:
    import functools
    ComparablePart = functools.total_ordering(ComparablePart)
    DebianVersion = functools.total_ordering(DebianVersion)

```

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-20