Skip to content

Commit 241e1e9

Browse files
DjiqMrsTonedOneoptimumtactY0SH1M4S73R
authored
Fixes some href exploits, general maintenance and changes the .proc/ to PROC_REF in preparation for 515 (#345)
* byond_compat * 515 compat * more 515 compat * [s] Require affirmative input from the admin to run sdql2 verbs (#76276) Powerful or dangerous admin verbs should have some prompt or forced runtime input to lower the attack surface once somebody finds a href exploit since topics can trigger commands and verbs. * Fix a href exploit in limbgrower (#76247) This could be used to spoof category which may then be useable to inject html into the tgui or into vv All credit to @PowerfulBacon BeeStation/BeeStation-Hornet#9274 * computer href * Fixes href exploits with the gas vendor (#66302) * fixes an href exploit with the gas vendor * you know what let's add these sanity checks while we're at it * generic maintenance pass --------- Co-authored-by: Kyle Spier-Swenson <[email protected]> Co-authored-by: oranges <[email protected]> Co-authored-by: Y0SH1M4S73R <[email protected]>
1 parent 789f402 commit 241e1e9

File tree

978 files changed

+2928
-2895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

978 files changed

+2928
-2895
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// So we want to have compile time guarantees these procs exist on local type, unfortunately 515 killed the PROC_REF(procname) syntax so we have to use nameof()
2+
#if DM_VERSION < 515
3+
/// Call by name proc reference, checks if the proc exists on this type or as a global proc
4+
#define PROC_REF(X) (.proc/##X)
5+
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
6+
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
7+
/// Call by name proc reference, checks if the proc is existing global proc
8+
#define GLOBAL_PROC_REF(X) (/proc/##X)
9+
#else
10+
/// Call by name proc reference, checks if the proc exists on this type or as a global proc
11+
#define PROC_REF(X) (nameof(.proc/##X))
12+
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
13+
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X))
14+
/// Call by name proc reference, checks if the proc is existing global proc
15+
#define GLOBAL_PROC_REF(X) (/proc/##X)
16+
#endif

code/__HELPERS/hearted.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if(!check_mob?.mind || !check_mob.client)
1515
continue
1616
// maybe some other filters like bans or whatever
17-
INVOKE_ASYNC(check_mob, /mob.proc/query_heart, 1)
17+
INVOKE_ASYNC(check_mob, TYPE_PROC_REF(/mob, query_heart), 1)
1818
number_to_ask--
1919
if(number_to_ask <= 0)
2020
break

code/__HELPERS/icons.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
12791279
for(var/A in transformation_objects)
12801280
vis_contents += A
12811281
if(reset_after)
1282-
addtimer(CALLBACK(src,.proc/_reset_transformation_animation,filter_index),time)
1282+
addtimer(CALLBACK(src,PROC_REF(_reset_transformation_animation),filter_index),time)
12831283

12841284
/*
12851285
* Resets filters and removes transformation animations helper objects from vis contents.

code/__HELPERS/priority_announce.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
to_chat(mob_to_teleport, announcement)
6565
SEND_SOUND(mob_to_teleport, meeting_sound) //no preferences here, you must hear the funny sound
6666
mob_to_teleport.overlay_fullscreen("emergency_meeting", /atom/movable/screen/fullscreen/emergency_meeting, 1)
67-
addtimer(CALLBACK(mob_to_teleport, /mob/.proc/clear_fullscreen, "emergency_meeting"), 3 SECONDS)
67+
addtimer(CALLBACK(mob_to_teleport, TYPE_PROC_REF(/mob, clear_fullscreen), "emergency_meeting"), 3 SECONDS)
6868

6969
if (is_station_level(mob_to_teleport.z)) //teleport the mob to the crew meeting
7070
var/turf/target

code/__HELPERS/qdel.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE)
2-
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
1+
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, PROC_REF(qdel), item), time, TIMER_STOPPABLE)
2+
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, PROC_REF(qdel), item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
33
#define QDEL_NULL(item) qdel(item); item = null
44
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
5-
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)
5+
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, PROC_REF(______qdel_list_wrapper), L), time, TIMER_STOPPABLE)
66
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
77
#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qdel(L[I]); L.Cut(); }
88

code/_onclick/hud/alert.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
animate(thealert, transform = matrix(), time = 2.5, easing = CUBIC_EASING)
6565

6666
if(thealert.timeout)
67-
addtimer(CALLBACK(src, .proc/alert_timeout, thealert, category), thealert.timeout)
67+
addtimer(CALLBACK(src, PROC_REF(alert_timeout), thealert, category), thealert.timeout)
6868
thealert.timeout = world.time + thealert.timeout - world.tick_lag
6969
return thealert
7070

@@ -326,7 +326,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
326326
add_overlay(receiving)
327327
src.receiving = receiving
328328
src.giver = giver
329-
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, .proc/check_in_range, override = TRUE) //Override to prevent runtimes when people offer a item multiple times
329+
RegisterSignal(taker, COMSIG_MOVABLE_MOVED, PROC_REF(check_in_range), override = TRUE) //Override to prevent runtimes when people offer a item multiple times
330330

331331
/atom/movable/screen/alert/give/proc/check_in_range(atom/taker)
332332
SIGNAL_HANDLER

code/_onclick/hud/credits.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
5454
target = M
5555
animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
56-
addtimer(CALLBACK(src, .proc/FadeOut), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
56+
addtimer(CALLBACK(src, PROC_REF(FadeOut)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
5757
QDEL_IN(src, CREDIT_ROLL_SPEED)
5858
P.screen += src
5959

code/_onclick/hud/fullscreen.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
if(animated)
2727
animate(screen, alpha = 0, time = animated)
28-
addtimer(CALLBACK(src, .proc/clear_fullscreen_after_animate, screen), animated, TIMER_CLIENT_TIME)
28+
addtimer(CALLBACK(src, PROC_REF(clear_fullscreen_after_animate), screen), animated, TIMER_CLIENT_TIME)
2929
else
3030
if(client)
3131
client.screen -= screen

code/_onclick/hud/parallax.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
C.parallax_movedir = new_parallax_movedir
131131
if (C.parallax_animate_timer)
132132
deltimer(C.parallax_animate_timer)
133-
var/datum/callback/CB = CALLBACK(src, .proc/update_parallax_motionblur, C, animatedir, new_parallax_movedir, newtransform)
133+
var/datum/callback/CB = CALLBACK(src, PROC_REF(update_parallax_motionblur), C, animatedir, new_parallax_movedir, newtransform)
134134
if(skip_windups)
135135
CB.Invoke()
136136
else

code/_onclick/hud/radial.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
1313
UnregisterSignal(parent, COMSIG_PARENT_QDELETING)
1414
parent = new_value
1515
if(parent)
16-
RegisterSignal(parent, COMSIG_PARENT_QDELETING, .proc/handle_parent_del)
16+
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(handle_parent_del))
1717

1818
/atom/movable/screen/radial/proc/handle_parent_del()
1919
SIGNAL_HANDLER

0 commit comments

Comments
 (0)