Просмотр исходного кода

Merge pull request #1635 from slingamn/pass

fix #1634 (forward-porting to master)
tags/v2.7.0-rc1
Shivaram Lingamneni 3 лет назад
Родитель
Сommit
e14aace1da
Аккаунт пользователя с таким Email не найден
5 измененных файлов: 38 добавлений и 13 удалений
  1. 16
    0
      CHANGELOG.md
  2. 4
    1
      default.yaml
  3. 1
    1
      docs/MANUAL.md
  4. 13
    10
      irc/config.go
  5. 4
    1
      traditional.yaml

+ 16
- 0
CHANGELOG.md Просмотреть файл

@@ -1,6 +1,22 @@
1 1
 # Changelog
2 2
 All notable changes to Oragono will be documented in this file.
3 3
 
4
+## [2.6.1] - 2021-04-26
5
+
6
+Oragono 2.6.1 is a bugfix release, fixing a security issue that is critical for some private server configurations. We regret the oversight.
7
+
8
+The issue affects two classes of server configuration:
9
+
10
+1. Private servers that use `server.password` (i.e., the `PASS` command) for protection. If `accounts.registration.allow-before-connect` is enabled, the `REGISTER` command can be used to bypass authentication. Affected operators should set this field to `false`, or upgrade to 2.6.1, which disallows the insecure configuration. (If the field does not appear in the configuration file, the configuration is secure since the value defaults to false when unset.)
11
+2. Private servers that use `accounts.require-sasl` for protection. If these servers do not additionally set `accounts.registration.enabled` to `false`, the `REGISTER` command can potentially be used to bypass authentication. Affected operators should set `accounts.registration.enabled` to false; this recommendation appeared in the operator manual but was not emphasized sufficiently. (Configurations that require SASL but allow open registration are potentially valid, e.g., in the case of public servers that require everyone to use a registered account; accordingly, Oragono 2.6.1 continues to permit such configurations.)
12
+
13
+This release includes no changes to the config file format or the database.
14
+
15
+Many thanks to [@ajaspers](https://github.com/ajaspers) for reporting the issue.
16
+
17
+### Security
18
+* Fixed and documented potential authentication bypasses via the `REGISTER` command (#1634, thanks [@ajaspers](https://github.com/ajaspers)!)
19
+
4 20
 ## [2.6.0] - 2021-04-18
5 21
 
6 22
 We're pleased to announce Oragono 2.6.0, a new stable release.

+ 4
- 1
default.yaml Просмотреть файл

@@ -435,7 +435,10 @@ accounts:
435 435
     # require-sasl controls whether clients are required to have accounts
436 436
     # (and sign into them using SASL) to connect to the server
437 437
     require-sasl:
438
-        # if this is enabled, all clients must authenticate with SASL while connecting
438
+        # if this is enabled, all clients must authenticate with SASL while connecting.
439
+        # WARNING: for a private server, you MUST set accounts.registration.enabled
440
+        # to false as well, in order to prevent non-administrators from registering
441
+        # accounts.
439 442
         enabled: false
440 443
 
441 444
         # IPs/CIDRs which are exempted from the account requirement

+ 1
- 1
docs/MANUAL.md Просмотреть файл

@@ -314,7 +314,7 @@ To enable this mode, set the following configs:
314 314
 
315 315
 This mode is comparable to Slack, Mattermost, or similar products intended as internal chat servers for an organization or team. In this mode, clients cannot connect to the server unless they log in with SASL as part of the initial handshake. This allows Oragono to be deployed facing the public Internet, with fine-grained control over who can log in.
316 316
 
317
-In this mode, clients must have a valid account to connect, so they cannot register their own accounts. Accordingly, an operator must do the initial account creation, using the `SAREGISTER` command of NickServ. (For more details, `/msg NickServ help saregister`.) To bootstrap this process, you can make an initial connection from localhost, which is exempt (by default) from the requirement, or temporarily add your own IP to the exemption list. You can also use a more permissive configuration for bootstrapping, then switch to this one once you have your account. Another possibility is permanently exempting an internal network, e.g., `10.0.0.0/8`, that only trusted people can access.
317
+In this mode, clients must not be allowed to register their own accounts, so user-initiated account registration must be disabled. Accordingly, an operator must do the initial account creation, using the `SAREGISTER` command of NickServ. (For more details, `/msg NickServ help saregister`.) To bootstrap this process, you can make an initial connection from localhost, which is exempt (by default) from the requirement, or temporarily add your own IP to the exemption list. You can also use a more permissive configuration for bootstrapping, then switch to this one once you have your account. Another possibility is permanently exempting an internal network, e.g., `10.0.0.0/8`, that only trusted people can access.
318 318
 
319 319
 To enable this mode, use the configs from the "nick equals account" section (i.e., start from `default.yaml`) and make these modifications:
320 320
 

+ 13
- 10
irc/config.go Просмотреть файл

@@ -1319,6 +1319,19 @@ func LoadConfig(filename string) (config *Config, err error) {
1319 1319
 
1320 1320
 	config.Accounts.defaultUserModes = ParseDefaultUserModes(config.Accounts.DefaultUserModes)
1321 1321
 
1322
+	if config.Server.Password != "" {
1323
+		config.Server.passwordBytes, err = decodeLegacyPasswordHash(config.Server.Password)
1324
+		if err != nil {
1325
+			return nil, err
1326
+		}
1327
+		if config.Accounts.LoginViaPassCommand && !config.Accounts.SkipServerPassword {
1328
+			return nil, errors.New("Using a server password and login-via-pass-command requires skip-server-password as well")
1329
+		}
1330
+		// #1634: accounts.registration.allow-before-connect is an auth bypass
1331
+		// for configurations that start from default and then enable server.password
1332
+		config.Accounts.Registration.AllowBeforeConnect = false
1333
+	}
1334
+
1322 1335
 	config.Accounts.RequireSasl.exemptedNets, err = utils.ParseNetList(config.Accounts.RequireSasl.Exempted)
1323 1336
 	if err != nil {
1324 1337
 		return nil, fmt.Errorf("Could not parse require-sasl exempted nets: %v", err.Error())
@@ -1409,16 +1422,6 @@ func LoadConfig(filename string) (config *Config, err error) {
1409 1422
 	// parse default channel modes
1410 1423
 	config.Channels.defaultModes = ParseDefaultChannelModes(config.Channels.DefaultModes)
1411 1424
 
1412
-	if config.Server.Password != "" {
1413
-		config.Server.passwordBytes, err = decodeLegacyPasswordHash(config.Server.Password)
1414
-		if err != nil {
1415
-			return nil, err
1416
-		}
1417
-		if config.Accounts.LoginViaPassCommand && !config.Accounts.SkipServerPassword {
1418
-			return nil, errors.New("Using a server password and login-via-pass-command requires skip-server-password as well")
1419
-		}
1420
-	}
1421
-
1422 1425
 	if config.Accounts.Registration.BcryptCost == 0 {
1423 1426
 		config.Accounts.Registration.BcryptCost = passwd.DefaultCost
1424 1427
 	}

+ 4
- 1
traditional.yaml Просмотреть файл

@@ -407,7 +407,10 @@ accounts:
407 407
     # require-sasl controls whether clients are required to have accounts
408 408
     # (and sign into them using SASL) to connect to the server
409 409
     require-sasl:
410
-        # if this is enabled, all clients must authenticate with SASL while connecting
410
+        # if this is enabled, all clients must authenticate with SASL while connecting.
411
+        # WARNING: for a private server, you MUST set accounts.registration.enabled
412
+        # to false as well, in order to prevent non-administrators from registering
413
+        # accounts.
411 414
         enabled: false
412 415
 
413 416
         # IPs/CIDRs which are exempted from the account requirement

Загрузка…
Отмена
Сохранить