cybermonkj / qatest

Audit required: Use of an insecure method method from urllib detected BAN-B310
Security
Major
12 occurrences in this check
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
608        # Api call to read data for northumbria
609        with urllib.request.urlopen(northumbriaUrl_04_2021) as resp1:
610            northumbria2021Data = resp1.read()
611        with urllib.request.urlopen(northumbriaUrl_04_2020) as resp2:612            northumbria2020Data = resp2.read()
613            # Api call to read data for cleveland
614
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
606        northumbriaUrl_04_2021 = getUrl("northumbria", "2021-03")
607        northumbriaUrl_04_2020 = getUrl("northumbria", "2020-04")
608        # Api call to read data for northumbria
609        with urllib.request.urlopen(northumbriaUrl_04_2021) as resp1:610            northumbria2021Data = resp1.read()
611        with urllib.request.urlopen(northumbriaUrl_04_2020) as resp2:
612            northumbria2020Data = resp2.read()
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
553        # Api call to read data for northumbria
554        with urllib.request.urlopen(northumbriaUrl_04_2021) as resp1:
555            northumbria2021Data = resp1.read()
556        with urllib.request.urlopen(northumbriaUrl_04_2020) as resp2:557            northumbria2020Data = resp2.read()
558            # Api call to read data for cleveland
559
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
551        # clevelandUrl_07_2021   = getUrl("cleveland", "2021-07")
552        # clevelandUrl_08_2021   = getUrl("cleveland", "2021-08")
553        # Api call to read data for northumbria
554        with urllib.request.urlopen(northumbriaUrl_04_2021) as resp1:555            northumbria2021Data = resp1.read()
556        with urllib.request.urlopen(northumbriaUrl_04_2020) as resp2:
557            northumbria2020Data = resp2.read()
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
467            clevelandJuneData = resp4.read()
468        with urllib.request.urlopen(clevelandUrl_07_2021) as resp5:
469            clevelandJulyData = resp5.read()
470        with urllib.request.urlopen(clevelandUrl_08_2021) as resp6:471            clevelandAugustData = resp6.read()
472        # Read and load data in panada dataframe
473        json_format_cleveland_june = json.loads(clevelandJuneData)
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
465        # Api call to read data for cleveland
466        with urllib.request.urlopen(clevelandUrl_06_2021) as resp4:
467            clevelandJuneData = resp4.read()
468        with urllib.request.urlopen(clevelandUrl_07_2021) as resp5:469            clevelandJulyData = resp5.read()
470        with urllib.request.urlopen(clevelandUrl_08_2021) as resp6:
471            clevelandAugustData = resp6.read()
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
463        with urllib.request.urlopen(northumbriaUrl_08_2021) as resp3:
464            northumbriaAugustData = resp3.read()
465        # Api call to read data for cleveland
466        with urllib.request.urlopen(clevelandUrl_06_2021) as resp4:467            clevelandJuneData = resp4.read()
468        with urllib.request.urlopen(clevelandUrl_07_2021) as resp5:
469            clevelandJulyData = resp5.read()
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
460            northumbriaJuneData = resp1.read()
461        with urllib.request.urlopen(northumbriaUrl_07_2021) as resp2:
462            northumbriaJulyData = resp2.read()
463        with urllib.request.urlopen(northumbriaUrl_08_2021) as resp3:464            northumbriaAugustData = resp3.read()
465        # Api call to read data for cleveland
466        with urllib.request.urlopen(clevelandUrl_06_2021) as resp4:
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
458        # Api call to read data for northumbria
459        with urllib.request.urlopen(northumbriaUrl_06_2021) as resp1:
460            northumbriaJuneData = resp1.read()
461        with urllib.request.urlopen(northumbriaUrl_07_2021) as resp2:462            northumbriaJulyData = resp2.read()
463        with urllib.request.urlopen(northumbriaUrl_08_2021) as resp3:
464            northumbriaAugustData = resp3.read()
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
456        clevelandUrl_07_2021 = getUrl("cleveland", "2021-07")
457        clevelandUrl_08_2021 = getUrl("cleveland", "2021-08")
458        # Api call to read data for northumbria
459        with urllib.request.urlopen(northumbriaUrl_06_2021) as resp1:460            northumbriaJuneData = resp1.read()
461        with urllib.request.urlopen(northumbriaUrl_07_2021) as resp2:
462            northumbriaJulyData = resp2.read()
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
411        )
412        with urllib.request.urlopen(clevelandUrl) as resp1:
413            clevelandData = resp1.read()
414        with urllib.request.urlopen(northumbriaUrl) as resp2:415            northumbriaData = resp2.read()
416        # Read and load data in panada dataframe
417        jsonFormatCleveland = json.loads(clevelandData)
Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
409        clevelandUrl = (
410            "https://data.police.uk/api/stops-force?force=cleveland&date=2021-06"
411        )
412        with urllib.request.urlopen(clevelandUrl) as resp1:413            clevelandData = resp1.read()
414        with urllib.request.urlopen(northumbriaUrl) as resp2:
415            northumbriaData = resp2.read()