Bug 3274 - Disallow names that are difficult to kick/ban
Status: RESOLVED WORKSFORME
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Admin system
Version: unspecified
Hardware: All All
: P3 enhancement
Assignee: Chris "Lakitu7" Schwarz
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2007-07-21 19:07 EDT by Chris "Lakitu7" Schwarz
Modified: 2009-10-09 23:28:34 EDT
1 user (show)

See Also:


Attachments
Implementation against 959 (1011 bytes, patch)
2007-07-21 19:07 EDT, Chris "Lakitu7" Schwarz
Remade patch, still against 959. (1.56 KB, patch)
2007-08-07 15:26 EDT, Chris "Lakitu7" Schwarz
modified, r966 (1.77 KB, patch)
2007-08-12 18:06 EDT, M. Kristall
blah (1.39 KB, patch)
2007-08-12 18:13 EDT, M. Kristall
disallow hard names, make kicking easier (2.65 KB, patch)
2007-11-01 21:38 EDT, M. Kristall
and slot numbers (3.06 KB, patch)
2007-11-04 00:18 EDT, M. Kristall
update of the above for head (1.74 KB, patch)
2009-10-08 03:57 EDT, Chris "Lakitu7" Schwarz

Description Chris "Lakitu7" Schwarz 2007-07-21 19:07:17 EDT
Disallows all-symbol names and names that are numbers < 64. Such names are difficult to kick/ban/pronounce/type. This just makes griefers' jobs a little more difficult.

Patch against 959
Comment 1 Chris "Lakitu7" Schwarz 2007-07-21 19:07:43 EDT
Created attachment 1446 [details]
Implementation against 959
Comment 2 M. Kristall 2007-08-03 11:45:00 EDT
Allowing names with numbers >= 64 is a problem with !setlevel. Probably just not allowing any numbers or spaces at the beginning of a name is a better bet.
Comment 3 Roman "kevlarman" Tetelman 2007-08-05 23:50:30 EDT
"//" shouldn't be allowed anywhere in a name. kicks by full name match (the vote menu in particular) will interpret // as a comment, so someone named "kevlarman@lamerspot//banme" would get me kicked instead of them unless a partial name (/kick banme) or client number was used. 
Comment 4 Chris "Lakitu7" Schwarz 2007-08-07 15:26:55 EDT
Created attachment 1472 [details]
Remade patch, still against 959.

Leading spaces were already stripped by SVN code (g_client.c/ClientCleanName()), so no change there.

This patch disallows names that:
Begin with a number
Contain no letters anywhere in them (are all numbers and/or symbols)
Contain "//" or "/*" anywhere in them
Comment 5 M. Kristall 2007-08-12 18:06:44 EDT
Created attachment 1475 [details]
modified, r966

This is basically identical to attachment 1472 [details]. I also fixed a bug in your patch (you used < instead of <= so only 1-8 would be counted as numbers) and make some other minor changes.
Comment 6 M. Kristall 2007-08-12 18:13:51 EDT
Created attachment 1476 [details]
blah

These aren't the droids you're looking for
Comment 7 /dev/humancontroller 2007-08-15 18:35:33 EDT
Sorry to interrupt your hard work, but this whole thing is invalid becuase you are trying to fix not the bug.

For example, if ladders can be exploited to climb higher than intended, what do you do?
1. A solution similar to this bug/post/thread would be: remove all ladder from all maps, or add physical blockers on top of all ladders. The bug is still there, but cannot be used. Stupid, stupid, stupid.
2. A perfect solution: fix the bug.

1.1.0 doesn't have any problems with kicking. It is an error of additional development, where security wan't in mind.

1. Tremulous 1.1.0 does not support searching for a name substring, but there is no problem with kicking by name. For example, to kick kevlarman, you would type /callvote kick "kevlarman@lamerspot//banme". Good, but not adequate. So:
2. Someone added code to ease kicking by searching for name substrings (that is, /callvote kick lamer would work here very well). Excellent job. Still on unpatched servers, kicking by client number has never been an issue, until:
3. Someone who doesn't know much about security consolidated /kick <name> and /clientkick <num> into /kick <name|num>. Nobody asked for such a consolidation, and I expect that anyone applying that patch should not complain (no warranty).

Removing the ability to use some names is a total pissoff for everyone's freedom. Besides, noone code can guarantee protection agains names like [&(*<!^@*&$]. Actually, the best admin menu I have ever seen is a standard UI. Right click on someone, and select kick.

More about the kick consolidation. It wasn't such a bad idea, for convenience purposes. But one kick command that "tries to predict what you want" is bad. (And I would be pissed to see it in the SVN.) Instead, I recommend something for all commands that relate to clients: generally /<cmd> <name> and /<cmd>n <num>. That is /kick <name> and /kickn <num>, !setlevel <name> and !setleveln <num>, etc.

And more about the "//" in name, it has been pointed out that using the built in command parser to do kicks and other commands is a bad way to implement votes. Use functions.

And even more about the leading spaces: nothing is wrong about them if you have a substring search kick, and require at least one alphanumeric charater.
Comment 8 Tim Angus 2007-08-15 18:59:23 EDT
DO NOT change bug priorities, severities, statuses or resolutions.
Comment 9 /dev/humancontroller 2007-08-15 19:08:22 EDT
Sry, didn't know I wasn't allowed.
Comment 10 M. Kristall 2007-11-01 21:38:45 EDT
Created attachment 1558 [details]
disallow hard names, make kicking easier

This changes G_SanitiseName() so name matches ignore non-alphanumeric characters. The initial idea was to save time in banning abusive players when they use a lot of symbols in their names. In addition to being really convenient for admins, it will also make it somewhat more difficult to impersonate other users, helping prevent the wrong person from getting banned.

(In reply to comment #7)
> 2. A perfect solution: fix the bug.

Fixing the bug is not an option in this case because the bug is in the users of the software, not the software itself.


> 3. Someone who doesn't know much about security consolidated /kick <name> and
> /clientkick <num> into /kick <name|num>. Nobody asked for such a consolidation,
> and I expect that anyone applying that patch should not complain (no warranty).

This has nothing to do with security and everything to do with convenience. This prevents people from having to know the subtle difference between kick and clientkick.


> It wasn't such a bad idea, for convenience
> purposes. But one kick command that "tries to predict what you want" is bad.

DWIM. People type things without thinking too much about it and don't want to have to correct themselves. Adding code to try to figure out what they meant is much faster and saves annoyance for the user.
Comment 11 M. Kristall 2007-11-04 00:18:33 EDT
Created attachment 1561 [details]
and slot numbers

This is the same thing as attachment 1558 [details] but also compares the slot number to the unmodified search string.
Comment 12 Baybal 2009-03-28 13:11:00 EDT
It is possible to use a newline as player name. Long time known bug.
Comment 13 Chris "Lakitu7" Schwarz 2009-03-28 13:41:23 EDT
(In reply to comment #12)
> It is possible to use a newline as player name. Long time known bug.

Was fixed in R1122. Are you able to reproduce this on a server using a revision later than 1122?
Comment 14 Baybal 2009-03-29 01:13:28 EDT
How to view server's version?
Comment 15 Chris "Lakitu7" Schwarz 2009-10-08 03:57:09 EDT
Created attachment 2145 [details]
update of the above for head

Updated the above for head. Some parts were obsolete and handled elsewhere now. Otherwise, nothing's changed. Since the original patch was written, SanitiseName has become SanitiseString, but seems to still be only used for the same set of instances that would benefit from this change. Its implementation has also since changed slightly to fix some buffer bugs. I think I have updated this correctly to leave those alone, but it'd be nice if somebody else gave it a once-over. Otherwise, this should be ready for ci, since it seemed to be ready ages ago and we just never did so.
Comment 16 Chris "Lakitu7" Schwarz 2009-10-08 12:42:44 EDT
Committed at r1748
Comment 17 Baybal 2009-10-09 10:05:18 EDT
It is still possible to pass DOS like line termination /0 into player's name and some other strings like guid to circumvent checks.
Some servers simply crashes some makes player a "ghost". Probably it depends on server's OS.
Comment 18 Chris "Lakitu7" Schwarz 2009-10-09 23:28:34 EDT
(In reply to comment #17)
> It is still possible to pass DOS like line termination /0 into player's name
> and some other strings like guid to circumvent checks.
> Some servers simply crashes some makes player a "ghost". Probably it depends on
> server's OS.

Most 1.1 servers are not updated. Those bugs were fixed here:
http://svn.icculus.org/tremulous?view=rev&revision=1193
All infostrings must pass isprint() for anyone to connect.

I just tried it on SVN head -- I hacked up a client to put a newline and a null char in my name, and was not allowed to connect because of illegal or malformed userinfo. The same is true of guid. 

Compile a client using SVN head and connect to one of the protocol 70 servers (or test locally on your freshly-compiled version). If you can do it there, then reopen the bug. If not, no, you're not testing modern code.