mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2025-03-29 22:01:21 +00:00
Jailed link paths to gamedir, fixing known exploit:
rcon link /etc owned download owned/sensitivefile
This commit is contained in:
parent
cdc2e36cf7
commit
e1326ba6f7
1 changed files with 9 additions and 0 deletions
|
@ -719,12 +719,21 @@ Creates a filelink_t
|
|||
*/
|
||||
void FS_Link_f(void){
|
||||
filelink_t *l, **prev;
|
||||
char *from;
|
||||
|
||||
if(Cmd_Argc() != 3){
|
||||
Com_Printf("USAGE: link <from> <to>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
from = Cmd_Argv(1);
|
||||
|
||||
// jail link sources to gamedir
|
||||
if(strstr(from, "..") || *from == '/' || *from == '.'){
|
||||
Com_Printf("Illegal path name %s\n", from);
|
||||
return;
|
||||
}
|
||||
|
||||
// see if the link already exists
|
||||
prev = &fs_links;
|
||||
for(l = fs_links; l; l = l->next){
|
||||
|
|
Loading…
Reference in a new issue