isudatateam / datateam

Hardcoded temporary directory detected BAN-B108
Security
Major
3 months ago3 months old
Probable insecure usage of temp file/directory.
349    html += """<p>That is all...</p>"""
350    # debugging
351    if len(sys.argv) == 3:
352        with open("/tmp/out.html", "w", encoding="utf-8") as fh:353            fh.write(html)
354    msg = MIMEMultipart("alternative")
355    msg["Subject"] = (
Probable insecure usage of temp file/directory.
738    _s = smtplib.SMTP("localhost")
739    _s.sendmail(msg["From"], msg["To"], msg.as_string())
740    _s.quit()
741    os.unlink("/tmp/cscap.xlsx")742    pgconn = get_dbconn("sustainablecorn")
743    cursor = pgconn.cursor()
744    cursor.execute(
Probable insecure usage of temp file/directory.
727    tmpfn = ("cscap_%s.xlsx") % (
728        datetime.datetime.utcnow().strftime("%Y%m%d%H%M%S"),
729    )
730    shutil.copyfile("/tmp/cscap.xlsx", "/var/webtmp/%s" % (tmpfn,))731    uri = "https://datateam.agron.iastate.edu/tmp/%s" % (tmpfn,)
732    etext = EMAILTEXT % (
733        datetime.datetime.utcnow().strftime("%d %B %Y %H:%M:%S"),
Probable insecure usage of temp file/directory.
675        missing = environ.get("custom_missing", "M")
676    detectlimit = environ.get("detectlimit", "1")
677
678    writer = pd.ExcelWriter("/tmp/cscap.xlsx", engine="xlsxwriter")679
680    # First sheet is Data Dictionary
681    if "SHM5" in shm:
Probable insecure usage of temp file/directory.
 8
 9X = {"Arlington": "ARL", "Marshfield": "MAR", "Lancaster": "LAN"}
10
11df = pd.read_excel("/tmp/weather11-15.xls")12print("Found %s entries, columns: %s" % (len(df.index), df.columns))
13df["station"] = df["Location"].apply(lambda x: X[x])
14for i, row in df.iterrows():