    def _load_yamlconfig(self, configfile):
        yamlconfig = None
        try:
            if self._recent_pyyaml():
                # https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
                # only for 5.1+
                yamlconfig = yaml.load(open(configfile), Loader=yaml.FullLoader)
            else:
                yamlconfig = yaml.load(open(configfile))
        except yaml.YAMLError as exc:
            logger.error("Error in configuration file {0}:".format(configfile))
            if hasattr(exc, 'problem_mark'):
                mark = exc.problem_mark
                raise PystemonConfigException("error position: (%s:%s)" % (mark.line + 1, mark.column + 1))
        for includes in yamlconfig.get("includes", []):
            try:
                logger.debug("loading include '{0}'".format(includes))
                yamlconfig.update(yaml.load(open(includes)))
            except Exception as e:
                raise PystemonConfigException("failed to load '{0}': {1}".format(includes, e))
        return yamlconfig
The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.