From b9f41db32ced373c4889b47fad485249b8f01021 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 12 Apr 2017 20:54:17 -0400 Subject: [PATCH] [s] Fixes an exploit allowing admins to read any file (#26107) * THE SECURITY HOLE PILE DON'T STOP GETTING TALLER * ARE YOU FUCKING SERIOUS? --- code/modules/mapping/map_template.dm | 11 ++--------- code/modules/tooltip/tooltip.dm | 3 +-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index ca576d24e6e..d47c4da04b2 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -46,7 +46,7 @@ var/x = round(world.maxx/2) var/y = round(world.maxy/2) - var/list/bounds = maploader.load_map(get_file(), x, y) + var/list/bounds = maploader.load_map(file(mappath), x, y) if(!bounds) return FALSE @@ -67,7 +67,7 @@ if(T.y+height > world.maxy) return - var/list/bounds = maploader.load_map(get_file(), T.x, T.y, T.z, cropMap=TRUE) + var/list/bounds = maploader.load_map(file(mappath), T.x, T.y, T.z, cropMap=TRUE) if(!bounds) return @@ -77,13 +77,6 @@ log_game("[name] loaded at at [T.x],[T.y],[T.z]") return TRUE -/datum/map_template/proc/get_file() - if(mappath) - . = file(mappath) - - if(!.) - world.log << "The file of [src] ([mappath]) appears to be empty/non-existent." - /datum/map_template/proc/get_affected_turfs(turf/T, centered = FALSE) var/turf/placement = T if(centered) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 11d60ca07b8..5d074286ebc 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -34,7 +34,6 @@ Notes: /datum/tooltip var/client/owner var/control = "mainwindow.tooltip" - var/file = 'code/modules/tooltip/tooltip.html' var/showing = 0 var/queueHide = 0 var/init = 0 @@ -43,7 +42,7 @@ Notes: /datum/tooltip/New(client/C) if (C) src.owner = C - src.owner << browse(file2text(src.file), "window=[src.control]") + src.owner << browse(file2text('code/modules/tooltip/tooltip.html'), "window=[src.control]") ..()