Commit Graph

261 Commits

Author SHA1 Message Date
Terry Geng
e90eb8c4cd
src: Made CryptState an abstract class, in order to support multiple crypto types in the future. Moved all crypto-related files into src/crypto. 2020-06-06 20:37:59 +08:00
Alex Scorer
da3f5f54e2 ACL:Add new permission for Reset Comment/Avatar in server & client
This commit introduces a new permission, ResetUserContent, to grant the ability to reset another user's comment or avatar.
It also includes a check in the ACL editor window. If the server version is less than 1.4.0 then don't show the new permission in the ACL checkbox list as the server won't respond to it.
On older servers the Move permission in the root channel was also used for allowing or denying comment and avatar changes.
2020-06-02 23:25:23 +01:00
Robert Adam
e839bb2a9e src: Allow listener proxies in the same channel the actual user is in
Before you weren't able to place a listener proxy (ChannelListener) into
the same channel that you're currently in and if you joined a channel
that you were listening to before, your listener proxy would be removed
from that channel.

It was brought to my attention though that there are cases in which a
person wants to hear what's going on in several channels and thus places
listener proxies into them. However if that same person needs to
constantly hop between these listened channels (e.g. to talk to the
folks in there), it gets very annoying as that person constantly has to
think about re-adding the listener proxy into the channel it just left.
2020-05-04 17:54:16 +02:00
Robert Adam
650e18d79e src/murmur: Fix ChannelListener not hearing shout if no real user is in shouted channel
If you placed a listener proxy into an empty channel and someone was
shouting to that channel, you'd still not hear any of that. This is
because the old processing logic was injected into the code for the
normal shouting feature. However if there is no user in the channel, the
shouting feature won't do anything.

This commit added the listener targets as a separate entry in the
WhisperTargetCache in order for it to be processed independently of
normal shouts. It also had to tweak the logic for how and when to clean
the WhisperTargetCache in order for this to work nicely with
ChannelListeners as well.
2020-04-30 09:27:27 +02:00
Robert Adam
466479992d src/murmur/Messages.cpp: Restrict string sizes for Version information
Before this commit it was possible to pass more or less arbitrary sized
strings as part of the Version message. This could lead to malicious
clients sending huge strings as part of this message.
The problem arises once these Strings are displayed in the UI (e.g. once
a user selects Information from the context menu of such a malicious
client). Qt will then be so busy to render this String that it
completely freezes the UI (#4067).

This commit prevents this attack by restricting the size of the Version
strings on the server side. If a client sends strings that exceed this
size, the server will drop the original content and replace it with a
generic "[[Invalid]]".
2020-04-24 11:08:58 +02:00
Robert Adam
db465f0b42 src/murmur/Messages.cpp: Warn older clients about ChannelListener feature
ChannelListener will be introduced with Mumble 1.4.0 but older clients
will not know what these are. Thus they won't show them in their UI
which could lead to users being listened to without noticing.

In order to solve this issue, this commit implements a logic on the
Server that'll inform older clients about this possibility by sending
them a TextMessage right after they have authenticated (and after they
have received the server's welcome text).
2020-04-22 18:23:29 +02:00
Robert Adam
8aadee917d Feature: Channel Listeners
This implements #3319 by allowing users to "listen" to a channel they
have not joined. Doing so will place a "listener proxy" (in other
software this is sometimes known as a "phantom") in that channel which
will look like a normal user except that it'll have the same name as the
user listening to that channel and an ear-icon instead of the normal
avatar-icon. It will also always show a muted-icon next to it.

If a listener proxy is in a channel, the server will route all audio
packets from that channel to the user the proxy belongs to (as if that
user was in the channel). Note though that the opposite of this is not
true: The users in the channel will not hear audio from the listening
user unless that user decides to join the channel.

Furthermore it is possible to set a local volume adjustment for each
individual proxy that will be applied to all audio that is received
through it.
2020-04-16 09:29:49 +02:00
Daniel Lublin
dd748d640d src/murmur/Messages.cpp: Log also the OSVersion that has been extracted 2020-04-04 17:10:22 +02:00
Robert Adam
d45e7e0796 Murmur-Feature: Ability to log ACL and/or group changes
As requested in #2481, this commit introduces the option to print
changes of ACLs and/or groups to the server-log. These logs then contain
the ALCs/groups before the change and after it and should thereby grant
all information necessary to debug what is going on with them.
2020-03-29 19:47:14 +02:00
Robert Adam
5a4f5297a3
Merge pull request #3929: Improve channel password handling 2020-02-28 19:18:48 +01:00
Robert Adam
69fe7c6909 Protocol: Added fields 'is_enter_restricted' and 'can_enter' to the ChannelState message in order for the protocol to be able to tell clients about which channels they will be able to enter 2020-02-28 18:41:00 +01:00
Robert Adam
84735650d5
Merge pull request #3978: Fixups for #3927 2020-02-27 18:30:22 +01:00
Robert Adam
b0270e0562
Merge pull request #3958: Replace deprecated constructs 2020-02-27 17:03:04 +01:00
Robert Adam
2fe853b042 murmur/Messages.cpp: Use const reference in foreach loop 2020-02-27 16:04:24 +01:00
Robert Adam
cb00b828e1 murmur/Messages.cpp: Formatted class-member initializer list 2020-02-27 16:04:00 +01:00
Robert Adam
f53d935312 murmur/Messages.cpp: Added periods to the end of sentences in comments 2020-02-27 15:53:26 +01:00
Robert Adam
c6a0984383 Qt: Adapted to use range-based constructors for lists/vectors/sets for
Qt 5.14 and higher

Qt 5.14 introduces a bunch of range-based constructors for the various
collection-classes that are now to be preferred over the generic
toList(), toSet(), toXY() functions
2020-02-27 15:29:48 +01:00
Robert Adam
85d793eece ProtoBuf: Replaced ByteSize() with ByteSizeLong() for Protobuf 3.4 and
higher
2020-02-27 15:26:45 +01:00
Robert Adam
8bb5cafcac Merge PR #3927: Added support for temporary access tokens 2020-02-08 14:02:29 +01:00
Davide Beatrici
4e67a2fafb Auto-update LICENSE.header in source files 2020-01-07 03:09:22 +01:00
Robert Adam
6bc6c9e822 src/murmur/Messages.cpp: Take case-sensitivity into account for temporary access tokens 2020-01-02 13:16:08 +01:00
Robert Adam
1c38b53fdf AccessTokens: Added support for temporary access tokens in the UserState message 2019-12-28 12:22:37 +01:00
Davide Beatrici
efb3c83512 Fix dangling else warning in Server::msgACL()
This commit fixes a warning encountered today on FreeBSD, probably because Clang was updated and now `-Wdangling-else` is enabled by default.

Messages.cpp:1330:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
                                foreach(int id, pg->members()) {
                                ^
2019-10-07 08:49:47 +02:00
Davide Beatrici
15831dbca8 Add missing includes for "no-pch" build
This commit adds all the missing includes when the PCH header is not used.

Also, some includes are reordered and/or made consistent (e.g. "#include <QtEndian>" -> "#include <QtCore/QtEndian>").
2019-09-12 22:08:39 +02:00
Davide Beatrici
5a07244a44 Don't include PCH headers directly
According to Qt's documentation the PCH header doesn't need to be included.

From https://doc.qt.io/qt-5/qmake-precompiledheaders.html:

"To make your project use precompiled headers, you only need to define the PRECOMPILED_HEADER variable in your project file."

"qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to include the precompiled header file in HEADERS, as qmake will do this if the configuration supports precompiled headers."
2019-09-12 00:13:35 +02:00
Davide Beatrici
b427333257 Auto-update LICENSE.header in source files 2019-01-25 04:56:19 +01:00
Davide Beatrici
3edc46ff73 Murmur: fix Denial of Service vulnerability in msgChannelState()
The vulnerability was kindly reported by the "zom.bi" (https://zom.bi) community, who also provided a patch, which is applied in this commit.

Thank you very much for your support!
2019-01-25 03:20:20 +01:00
MadMaurice
0daec57f5c Prevent instability and crash due to message flood
This patch adds a rate limiting to selected patches. The underlying rate limiter
used is the Leaky-Bucket algorithm. It allows for a burst of messages, but
limits them after a specified amount of messages within a time frame.
2018-08-30 19:53:05 +02:00
Stefan Hacker
5b034be575 Accept incompatibility with other 1.3 pre-release snapshots
Those now only say permission denied without a proper
reason.
2018-06-15 00:19:52 +02:00
Stefan Hacker
46cd35c847 Fix typo 2018-06-14 01:06:00 +02:00
Stefan Hacker
9e0526c485 Introduce channelcountlimit to limit max channels per server
Having to many channels on a server can impact performance to the point
of making the instance unusably slow. This can be a problem for hosters
that allow their users unlimited channel creation.

This patch introduces a new per-server configuration parameter
channelcountlimit which can be used to configure a maximum number of
channels that may be created on each of the virtual servers. Once the
limit is reached channel creation will be rejected with permission
denied.

To allow a translated error message we have to bump the client version
to 1.3.1 to be able to use a fallback message for older clients.

As usual dbus, ice and grpc can ignore this limit. It is only enforced
against clients.
2018-06-14 00:50:50 +02:00
Mikkel Krautz
f6ba3a52bf Auto-update LICENSE.header in source files. 2018-01-01 23:05:37 +01:00
Mikkel Krautz
4d256ca675 CryptState: introduce AES_KEY_SIZE_* constants.
This change modifies CryptState to use AES_KEY_SIZE_BYTES and
AES_KEY_SIZE_BITS constants instead of using AES_BLOCK_SIZE.

This cleans up the code, making it easier to read and understand.
The key size is a distinct concept from the block size, even though
Mumble only offiiclaly supports OCB-AES128.

This also allows users of custom builds to bump their key size to
256-bit, if they desire. Of course, such builds will not be compatible
with any existing Mumble server, because neither Mumble nor Murmur
currently supports negotiating the crypto mode used for voice packets.
2017-01-20 00:04:07 +01:00
Mikkel Krautz
91ebb8b0b5 Update tree copyrights to 2017. 2017-01-08 21:05:57 +01:00
Kissaki
628ddc3a3e Remove most of channel name restriction
The server has a regular expression setting for channel names.
The additional restriction of having a word character is probably
reasonable for most users.
However, it is an arbitrary limitation that users may want to circumvent.
For example: A channel could not be named with hyphens only "---".

As this is an arbitrary and invisible limitation, whichs use case is
covered by the channelname setting (with a default, and adjustable by the
user) remove it.

We still prevent 0-length channel names as a special case, as they could
lead to issues in existing code paths (even when they should not with
consistently correct implementation).
2016-11-02 22:18:27 +01:00
Mikkel Krautz
cf6a5b7088 Hold write lock on qrwlVoiceThread when writing to bDeaf, bMute and bSuppress. 2016-06-24 00:03:12 +02:00
Mikkel Krautz
c8bd94195a Hold write lock on qrwlVoiceThread when writing to bSelfDeaf, bSelfMute and ssContext. 2016-06-24 00:03:12 +02:00
Mikkel Krautz
80c6e311e2 Writing to User->sState requires holding qrwlVoiceThread. 2016-06-24 00:03:12 +02:00
Mikkel Krautz
b1285fc5e3 Ensure all ACL write operations hold qrwlVoiceThread. 2016-06-24 00:03:12 +02:00
Mikkel Krautz
f03b74db2d Add mutex for csCrypt usage in Murmur. 2016-06-24 00:03:11 +02:00
Mikkel Krautz
f260bd1913 Implement correct write locking for addChannel/removeChannel/link/unlink. 2016-06-24 00:03:11 +02:00
Mikkel Krautz
f66b0d34c8 Rename qrwlUsers to qrwlVoiceThread. 2016-06-24 00:03:11 +02:00
spede
5d1a56e6e8 Add logging for ban removals/changes.
Fixes mumble-voip/mumble#1996
2016-05-19 00:31:42 +02:00
Mikkel Krautz
54c28d3ee1 src/murmur: update to use LICENSE.header. 2016-05-10 22:42:02 +02:00
Mikkel Krautz
a107fb3d71 grpc: fix formatting of textMessageFilter result handling. 2016-05-08 16:45:52 +02:00
Tim Cooper
805c0477c1 grpc: implement TextMessageFilter 2016-05-08 16:45:52 +02:00
Mikkel Krautz
c22393e9db Messages, Murmur.ice: make username checking case insensitive throughout Murmur.
The database query for looking up users in ServerDB has always been
case insensitive.

This commit makes the "duplicate user"-check in Messages.cpp case
insensitive as well.

Furthermore, this commit updates the documentation for the authenticate()
callback in Murmur.ice to document that authenticators should strive to
make usernames case insensitive.

Fixes mumble-voip/mumble#1078
2016-01-05 00:00:29 +01:00
Tim Cooper
fea39f2008 Respect maximum channel user limits when joining server
Fixes mumble-voip/mumble#1930
2015-11-28 10:17:22 +01:00
Tim Cooper
0b0c074dda Allow users with Write permission to bypass channel user limits
Fixes mumble-voip/mumble#1920
2015-11-24 19:30:02 +01:00
Tim Cooper
c0879e57bf Allow creating channel with a set maximum number of users
Fixes mumble-voip/mumble#1913
2015-11-22 17:31:21 +01:00