404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.129.24.240: ~ $
# defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See https://www.python.org/psf/license for licensing details.
"""Defuse XML bomb denial of service vulnerabilities
"""
from __future__ import print_function, absolute_import

from .common import (
    DefusedXmlException,
    DTDForbidden,
    EntitiesForbidden,
    ExternalReferenceForbidden,
    NotSupportedError,
    _apply_defusing,
)


def defuse_stdlib():
    """Monkey patch and defuse all stdlib packages

    :warning: The monkey patch is an EXPERIMETNAL feature.
    """
    defused = {}

    from . import cElementTree
    from . import ElementTree
    from . import minidom
    from . import pulldom
    from . import sax
    from . import expatbuilder
    from . import expatreader
    from . import xmlrpc

    xmlrpc.monkey_patch()
    defused[xmlrpc] = None

    for defused_mod in [
        cElementTree,
        ElementTree,
        minidom,
        pulldom,
        sax,
        expatbuilder,
        expatreader,
    ]:
        stdlib_mod = _apply_defusing(defused_mod)
        defused[defused_mod] = stdlib_mod

    return defused


__version__ = "0.6.0"

__all__ = [
    "DefusedXmlException",
    "DTDForbidden",
    "EntitiesForbidden",
    "ExternalReferenceForbidden",
    "NotSupportedError",
]

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
ElementTree.py File 4.18 KB 0644
__init__.py File 1.32 KB 0644
cElementTree.py File 1.02 KB 0644
common.py File 3.97 KB 0644
expatbuilder.py File 3.64 KB 0644
expatreader.py File 2.14 KB 0644
lxml.py File 4.84 KB 0644
minidom.py File 1.84 KB 0644
pulldom.py File 1.14 KB 0644
sax.py File 1.44 KB 0644
xmlrpc.py File 5.24 KB 0644