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