Line
Link Here
|
|
Game maps can in cube2-engine games be transmitted either from server |
|
Game maps can in cube2-engine games be transmitted either from server |
1 |
to client or from client to client, which includes a config file |
1 |
to client or from client to client, which includes a config file |
2 |
(mapname.cfg) which is in "cubescript" format, this makes it possible |
2 |
(mapname.cfg) which is in "cubescript" format, this makes it possible |
3 |
for an attacker to send a malign script via a new map (which must be |
3 |
for an attacker to send a malign script via a new map (which must be |
4 |
chosen by admin on a server, or created in cooperative editing mode). A |
4 |
chosen by admin on a server, or created in cooperative editing mode). A |
5 |
script like this could trivially read/write to any files which the user |
5 |
script like this could trivially read/write to any files which the user |
6 |
running the client has access to (it is executed when the client loads |
6 |
running the client has access to (it is executed when the client loads |
7 |
the map). |
7 |
the map). |
8 |
. |
8 |
. |
9 |
This patch stops "textedit" commands being able to be run in map-run |
9 |
This patch stops "textedit" commands being able to be run in map-run |
10 |
scripts, thus disabling the ability to read/write to user files. |
10 |
scripts, thus disabling the ability to read/write to user files. |
11 |
-- a/src/engine/textedit.h |
11 |
++ b/src/engine/textedit.h |
Lines 690-696
Link Here
|
690 |
|
690 |
|
691 |
#define TEXTCOMMAND(f, s, d, body) ICOMMAND(0, f, s, d,\ |
691 |
#define TEXTCOMMAND(f, s, d, body) ICOMMAND(0, f, s, d,\ |
692 |
editor *top = currentfocus();\ |
692 |
editor *top = currentfocus();\ |
693 |
if(!top) return;\ |
693 |
if(!top || identflags&IDF_WORLD) return;\ |
694 |
body\ |
694 |
body\ |
695 |
) |
695 |
) |
696 |
|
696 |
|