"save pak0.pak" vulnerability
Moderator: InsideQC Admins
19 posts
• Page 1 of 2 • 1, 2
"save pak0.pak" vulnerability
Curiosity overwrites the pak file...
If you do a save game with arbitrary names, the engine should check if it might overwrite existing files (and then prompt) and probably make sure the extension is .sav.
I tested Requiem, Quakespasm, Fitzquake, Darkplaces and FTEQW with this.
Fitzquake and by extension Quakespasm are affected as is Darkplaces. FTEQW fails silently and Requiem saves as pak0.sav.
Quakespasm's output on Linux:
and on the next start:
Please always append .sav to savegames if the user-supplied name does not already end in .sav!
edit: I hope it is clear that this affects all commands/cvars where filenames are supplied by the user or server!
If you do a save game with arbitrary names, the engine should check if it might overwrite existing files (and then prompt) and probably make sure the extension is .sav.
I tested Requiem, Quakespasm, Fitzquake, Darkplaces and FTEQW with this.
Fitzquake and by extension Quakespasm are affected as is Darkplaces. FTEQW fails silently and Requiem saves as pak0.sav.
Quakespasm's output on Linux:
]save pak0.pak
Saving game to /home/me/.quakespasm/id1/pak0.pak...
and on the next start:
QUAKE ERROR: ./id1/pak0.pak is not a packfile
Please always append .sav to savegames if the user-supplied name does not already end in .sav!
edit: I hope it is clear that this affects all commands/cvars where filenames are supplied by the user or server!
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Re: "save pak0.pak" vulnerability
It seems like an original bug, I tried it with the shareware. How on earth did this survive 18 years?
QUAKE.EXE even lets me write relative paths like "save ../config.sys", that sounds familiar though and I know some engines have at least that fixed.
I am sure other filesystem writing commands are affected too.
QUAKE.EXE even lets me write relative paths like "save ../config.sys", that sounds familiar though and I know some engines have at least that fixed.
I am sure other filesystem writing commands are affected too.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Re: "save pak0.pak" vulnerability
its not just saved games. try it with demos too. and frik_file etc
also, try:
game . ; gamedir . ; save opengl32.dll
also, try:
game . ; gamedir . ; save opengl32.dll
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: "save pak0.pak" vulnerability
save ..\..\..\..\..\..\msdos.sys
save ..\..\..\..\..\..\ntldr
save ..\..\..\..\..\..\boot.ini
echo "HA I FUCED UR SYSTEM BICH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Yeah this hole is fucking dangerous
Fortunately Windows 7 has VirtualStore these days...
save ..\..\..\..\..\..\ntldr
save ..\..\..\..\..\..\boot.ini
echo "HA I FUCED UR SYSTEM BICH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Yeah this hole is fucking dangerous
Fortunately Windows 7 has VirtualStore these days...
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Re: "save pak0.pak" vulnerability
add a clear command followed by a map change or something and they won't even realise you did it.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: "save pak0.pak" vulnerability
Testing a patch to fix this.
Read the code before posting such a thing.
leileilol wrote:save ..\..\..\..\..\..\msdos.sys
save ..\..\..\..\..\..\ntldr
save ..\..\..\..\..\..\boot.ini
echo "HA I FUCED UR SYSTEM BICH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Yeah this hole is fucking dangerous
Fortunately Windows 7 has VirtualStore these days...
Read the code before posting such a thing.
- szo
- Posts: 132
- Joined: Mon Dec 06, 2010 4:42 pm
Re: "save pak0.pak" vulnerability
Fixed in the quakespasm svn repository as of rev. 902:
http://sourceforge.net/p/quakespasm/code/902/
http://sourceforge.net/p/quakespasm/code/902/
- szo
- Posts: 132
- Joined: Mon Dec 06, 2010 4:42 pm
Re: "save pak0.pak" vulnerability
stuffcmd save pak0.pak
Just saying.
Bye again!
Just saying.
Bye again!
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Re: "save pak0.pak" vulnerability
mh wrote:stuffcmd save pak0.pak
Well, no longer an issue with quakespasm which will give you a nice and valid pak0.pak.sav now.
- szo
- Posts: 132
- Joined: Mon Dec 06, 2010 4:42 pm
Re: "save pak0.pak" vulnerability
mh wrote:stuffcmd save pak0.pak
Just saying.
Bye again!
Can you save in a multiplayer game?
- jitspoe
- Posts: 217
- Joined: Mon Jan 17, 2005 5:27 am
Re: "save pak0.pak" vulnerability
stuffcmd(self, "disconnect;maxplayers 1;deathmatch 0;coop 0;map start;save pak0.pak;quit\n");
yes, you can save in a multiplayer game.
yes, you can save in a multiplayer game.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: "save pak0.pak" vulnerability
Or just send "record pak0.pak".
I hope it is clear that this affects all commands/cvars where filenames are supplied by the user!
I hope it is clear that this affects all commands/cvars where filenames are supplied by the user!
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Re: "save pak0.pak" vulnerability
Spike wrote:stuffcmd(self, "disconnect;maxplayers 1;deathmatch 0;coop 0;map start;save pak0.pak;quit\n");
yes, you can save in a multiplayer game.
Touche.
On the plus side, it looks like this was fixed in Quake2, so idtech2+ based engine users shouldn't have to worry.
- jitspoe
- Posts: 217
- Joined: Mon Jan 17, 2005 5:27 am
Re: "save pak0.pak" vulnerability
Looks like Joe fixed this in JoeQuake long ago,
- Code: Select all
void COM_ForceExtension (char *path, char *extension)
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
19 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest