isudatateam / datateam

Hardcoded temporary directory detected BAN-B108
Security
Major
3 months ago3 months old
Probable insecure usage of temp file/directory.
106
107    fn = ",".join(stations)
108    res = open("/tmp/ss.xlsx", "rb").read()
109    os.unlink("/tmp/ss.xlsx")110    return res, fn
111
112
Probable insecure usage of temp file/directory.
105        worksheet.freeze_panes(3, 0)
106
107    fn = ",".join(stations)
108    res = open("/tmp/ss.xlsx", "rb").read()109    os.unlink("/tmp/ss.xlsx")
110    return res, fn
111
Probable insecure usage of temp file/directory.
 99    # re-establish the correct column sorting
100    df = df.reindex(cols, axis=1)
101
102    with pd.ExcelWriter("/tmp/ss.xlsx", engine="xlsxwriter") as writer:103        df.to_excel(writer, sheet_name="Daily Weather", index=False)
104        worksheet = writer.sheets["Daily Weather"]
105        worksheet.freeze_panes(3, 0)
Probable insecure usage of temp file/directory.
477    msg.preamble = "Data"
478    try:
479        shutil.copyfile(f"/tmp/{tmpfn}", f"/var/webtmp/{tmpfn}")
480        os.unlink(f"/tmp/{tmpfn}")481    except PermissionError:
482        pass
483    uri = f"https://datateam.agron.iastate.edu/tmp/{tmpfn}"
Probable insecure usage of temp file/directory.
476    msg["To"] = email
477    msg.preamble = "Data"
478    try:
479        shutil.copyfile(f"/tmp/{tmpfn}", f"/var/webtmp/{tmpfn}")480        os.unlink(f"/tmp/{tmpfn}")
481    except PermissionError:
482        pass