OreosLab / SSRSpeedN

Audit required: Use of an insecure method method from urllib detected BAN-B310
Security
Major
2 years ago2 years old
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
 84    if verbose:
 85        logger.debug(f"javascript url is{url}")
 86    try:
 87        url_result = urllib.request.urlopen(url) 88    except Exception:
 89        # connection is broken
 90        return 0
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
120    if verbose:
121        logger.debug(f"API url is{url}")
122    try:
123        url_result = urllib.request.urlopen(url=url, timeout=2)  # 2 second time-out124    except Exception:
125        # not good
126        if verbose:
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
 67    # go to fast.com to get the javascript file
 68    url = "https://fast.com/"
 69    try:
 70        url_result = urllib.request.urlopen(url) 71    except Exception:
 72        logger.exception("No connection at all")
 73        # no connection at all?
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
 26    and keep writing the number of bytes retrieved into result[index]
 27    """
 28    try:
 29        req = urllib.request.urlopen(url) 30    except urllib.error.URLError:
 31        result[index] = 0
 32        return