Fixes a ton of security issues (#19005)

This commit is contained in:
AffectedArc07
2022-09-10 14:12:16 +01:00
committed by GitHub
parent 474fc426a7
commit 279ee1dc12
13 changed files with 38 additions and 17 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
//SYSTEM
/proc/investigate_subject2file(subject)
return file("[INVESTIGATE_DIR][subject].html")
return wrap_file("[INVESTIGATE_DIR][subject].html")
/proc/investigate_reset()
if(fdel(INVESTIGATE_DIR)) return 1
+1 -1
View File
@@ -35,7 +35,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
var/outfit_file = input("Pick outfit json file:", "File") as null|file
if(!outfit_file)
return
var/filedata = file2text(outfit_file)
var/filedata = wrap_file2text(outfit_file)
var/json = json_decode(filedata)
if(!json)
to_chat(admin,"<span class='warning'>JSON decode error.</span>")
+3 -3
View File
@@ -30,11 +30,11 @@
message_admins("[key_name_admin(src)] accessed file: [path]")
switch(alert("View (in game), Open (in your system's text editor), or Download?", path, "View", "Open", "Download"))
if ("View")
src << browse("<pre style='word-wrap: break-word;'>[html_encode(file2text(file(path)))]</pre>", list2params(list("window" = "viewfile.[path]")))
src << browse("<pre style='word-wrap: break-word;'>[html_encode(wrap_file2text(wrap_file(path)))]</pre>", list2params(list("window" = "viewfile.[path]")))
if ("Open")
src << run(file(path))
src << run(wrap_file(path))
if ("Download")
src << ftp(file(path))
src << ftp(wrap_file(path))
else
return
to_chat(src, "Attempting to send [path], this may take a fair few minutes if the file is very large.")