Debian Codegraph @

doc/sources/admin/upgrade_2_x.rst

raw
1 Upgrade from 2.x to 2.y
2 =======================
3
4
5 Please apply general caution as you would with any software: have
6 backups and a rollback plan ready!
7
8 Known regressions in the latest released version
9 ------------------------------------------------
10
11 None at the moment
12
13 Security issue involving Nginx handlers
14 ---------------------------------------
15
16 In Nginx < 1.29.5, a hacker can workaround the correlation between a Nginx virtualHost and the "Host" field.
17 And despite its documentation and the RFC 9112, Nginx builds automatically the HTTP_HOST variable based on the
18 maybe-forged host header (fastCGI or uWSGI).
19 F5 fixes this but doesn't want to consider this as a security issue, therefore there will be no fix for previous
20 versions.
21
22 In Lemonldap-NG context this security issue may allow an attacker who has a valid account to gain privileges to
23 handler protected application, including the LemonLDAP::NG manager application if not protected by other means.
24
25 Default Nginx files installed in versions 2.16.8, 2.21.4, and 2.22.3 may help **but are not enough to fix the issue**.
26
27 You are vulnerable if you have:
28
29 * Nginx (< 1.29.5) as web server, AND one of:
30
31 * ``$http_host`` variable is used in your Nginx files
32 * OR you didn't force ``HTTP_HOST`` in your FastCGI/uWSGI parameters
33
34 * AND no network component able to block the bad request (haproxy blocks the poisoned requests for example)
35
36 If so, you MUST apply this fix for every virtual host.
37
38 You must spot these lines anywhere you're using FastCGI *(including Lemonldap-NG files of course)*::
39
40 fastcgi_param HOST $http_host;
41 # or if using uwsgi server:
42 #uwsgi_param HOST $http_host;
43
44 and **replace** them by::
45
46 fastcgi_param HTTP_HOST $host;
47 # or if using uwsgi server:
48 # Do not set this line if your /etc/nginx/uwsgi_params contains already this line
49 #uwsgi_param HTTP_HOST $host;
50
51 .. important::
52
53 If the HOST variable is not defined in a protected handler virtual host, you MUST still **add** the HTTP_HOST as defined above
54
55 For precaution measures, it is also recommended to fix the Host header sent when using Nginx as (reverse-)proxy. You should spot this line::
56
57 proxy_set_header Host $http_host;
58
59 and **replace** it by::
60
61 proxy_set_header Host $host;
62
63
64 2.23.0
65 ------
66
67 OAuth2 Handler now hides Access Tokens
68 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69
70 The :doc:`oauth2handler` no longer transmits the Access Token to the backend application after verifying it.
71
72 You you rely on this behavior, you can add a custom exported header such as
73
74 * Key: ``Auth-Token``
75 * Value: ``$_accessToken``
76
77 JQuery Cookie is no longer bundled
78 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79
80 LemonLDAP::NG no longer provides the ``jquery.cookie`` library. If you need this
81 library in your custom JS code, you need to add it back to
82 ``/usr/share/lemonldap-ng/portal/htdocs/static/`` directory, or use a CDN.
83
84 New index on CAS session
85 ~~~~~~~~~~~~~~~~~~~~~~~~
86
87 This new version can now manage backchannel logoutRequest coming from a CAS server (LL::NG configred as CAS client).
88
89 You need to add an index on CAS sessions table on ``auth_cas_ticket`` if you use a DB backend, and you want to use this new feature without impacting performances.
90
91 See ``sessions.my.sql`` and ``sessions.pg.sql`` to get SQL instructions.
92
93 2.22.2
94 ------
95
96 OpenID-Connect secrets
97 ~~~~~~~~~~~~~~~~~~~~~~
98
99 Starting from this version, LLNG follows strictly RFC 6749, so client\_id
100 and client\_secret are "URI-decoded" before comparison. In some rare case
101 this could generate a regression, then avoid using `%` character.
102
103 *sessionNotOnOrAfter duration* now starts when SAML response is built
104 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105
106 Previously, setting the *sessionNotOnOrAfter duration* on a SAML SP caused the
107 SAML response generated by LemonLDAP to indicate that the SAML session should
108 expire once that duration has elapsed since the user has logged in.
109
110 We now compute the requested session end time from the moment the SAML response
111 is generated, which can happen several hours after the user has logged in. If
112 you relied on the previous behavior, please adjust your configuration.
113
114 2.22.0
115 ------
116
117 lemonldap-ng-cli
118 ~~~~~~~~~~~~~~~~
119
120 Starting from this version, the ``lemonldap-ng-cli`` refuses to store
121 invalid configurations. If you use it with intermediate steps that are
122 invalid before next changes, use the new **--unsafe** option.
123
124 Stricter check on OIDC post-logout redirect URIs
125 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126
127 In logout scenarios involving disconnecting from a remote IDP, you may start to
128 encouter error messages that warn about unauthorized URIs.
129
130 This happens because the `post_logout_redirect_uri` is now more strictly
131 enforced in those scenarios. Make sure you have allowed the value of that
132 parameter in *OpenID Connect Relying Parties* > XXX > *Options* > *Logout* >
133 *Allowed redirection addresses for logout*
134
135 Change in post-logout redirect URI when LLNG is an OIDC client
136 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137
138 If you use :doc:`authopenidconnect`, to delegate authentication to an external
139 OpenID Connect provider, you have to update your provider's configuration in
140 order to allow a new *post-logout* redirect URIs::
141
142 https://<portal>/oauth2/rlogoutreturn
143
144 Change in timeout behavior for 2FA
145 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146
147 Contrary to previous versions, resending a 2FA code no longer extends the 2FA timeout anymore.
148
149 If your users start having issues with timeouts after upgrading, make sure you have set
150
151 *General parameters* » *Second factors* » *Global options* » *Login timeout* to a high enough value
152
153 In the particular case of email-based code delivery, you can override this parameter with
154
155 *General parameters* » *Second factors* » *Mail second factor* » *Code timeout*
156
157
158 Configuration update needed for OpenID Connect Providers that use signed requests
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
161 If you configured the following option:
162
163 OpenID Connect Providers » op-example » Options » Protocol » Token endpoint authentication method = client_secret_jwt or private_key_jwt
164
165 Then, starting with this version, you need to explicitely configure the desired algorithm in *Signature algorithm for token endpoint authentication*:
166
167 * For ``client_secret_jwt``, specify ``HS256`` or greater.
168 * For ``private_key_jwt``, specify ``RS256`` or greater if you are using a RSA key, or ``ES256`` or greater if you are using an EC key.
169
170 2.21.1
171 ------
172
173 Make sure no bogus CAS servers have been created
174 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175
176 Because of an issue in LemonLDAP::NG 2.21.0, your CAS applications might have
177 been erroneously created under the "CAS Servers" section as well.
178
179 Remove all unwanted **CAS Servers** entries from the manager after upgrading to
180 version 2.21.1 (or above) if this is the case.
181
182 2.21.0
183 ------
184
185 Log4Perl log level
186 ~~~~~~~~~~~~~~~~~~
187
188 Starting from this version, the global ``logLevel`` parameter is applied
189 for all loggers. Thus if you managed your log level inside the log4perl
190 configuration file, you may loose unimportant logs if your ``logLevel`` is
191 higher.
192
193 "typ" header in JWT
194 ~~~~~~~~~~~~~~~~~~~
195
196 Version earlier than 2.17.0 had a "typ" header in all JWT following OIDC
197 specification. In version 2.17.0, this header was wrongly removed when
198 JWT library changed. This header has been restored starting from version
199 2.21.0. However some application may fail with it, so a
200 ``Don't insert typ header`` option has been aded into RP/OP options to be
201 able to restore 2.17.0 behavior.
202
203
204 2.20.2
205 ------
206
207 Post-logout redirection
208 ~~~~~~~~~~~~~~~~~~~~~~~
209
210 Starting from this version, passing a ``url=`` parameter to the LemonLDAP logout
211 URL (``https://auth.example.com/logout`` or
212 ``https://auth.example.com/?logout=1``) will only redirect the user to this URL
213 if the URL's domain is a known VHost, or a trusted domain.
214
215 To add a new domain to the trusted domain list, use the ``trustedDomains``
216 variable or the *General parameters* > *Advanced parameters* > *Security* >
217 *Trusted domains*. Wildcards can be used to allow all subdomains.
218
219 2.20.0
220 ------
221
222 2FA deletion now uses a timeout
223 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224
225 Users may start encountering timeout errors if they remain on the 2FA manager
226 page too long before deleting their 2FA. In this situation, the page is
227 automatically refreshed. However, to improve user experience, you may want to
228 increase the *General Parameters* » *Second factors* » *Global options* »
229 *Login timeout* setting to increase the timeout.
230
231 Client secrets as GET parameters are no longer allowed
232 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233
234 When calling the OIDC ``/oauth2/token`` endpoint, we no longer allow the
235 ``client_secret`` parameter to be sent as an URL parameter. It has to be sent
236 either in the body (*client_secret_post*), or as part of and ``Authentication``
237 HTTP header (*client_secret_basic*).
238
239
240 U2F is no more supported
241 ~~~~~~~~~~~~~~~~~~~~~~~~
242
243 Current browsers no more support U2F specification which has been replaced by
244 **Webauthn**. Starting from version 2.20.0, LemonLDAP::NG no more supports U2F also.
245
246 You can easily replace **U2F** by **Webauthn**. LemonLDAP::NG provides also migration tools:
247
248 ::
249
250 lemonldap-ng-sessions secondfactors migrateu2f --all
251 lemonldap-ng-sessions secondfactors delType --all U2F
252
253 See :ref:`lemonldap-ng-sessions doc <cli-sessions>`
254
255 window.datas.login is no longer defined in JS code
256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257
258 The `window.datas.login` global JS variable used to contain the user's login.
259 It caused a security issue and was removed in this version. This only affects
260 users who wrote custom JS code for the portal and who explicitely used this
261 variable.
262
263 Status changed
264 ^^^^^^^^^^^^^^
265
266 The obsolete "portal status" and "status" features were removed from 2.20.0.
267 An alternative is available using :doc:`Use message broker to collect status <statuscollect>`.
268
269 SAML federations
270 ^^^^^^^^^^^^^^^^
271
272 The recommended way of configuring SAML federations is now to keep bundled metadata in a separate file.
273
274 Switching to this method should improve performance.
275
276 Check :doc:`SAML federation documentation <samlfederation>` to know how use this new method.
277
278 Auth::DBI no longer uses stored procedures to generate UNIX-style hashes
279 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
280
281 In this version, we no longer require stored procedures to generate
282 ``unixcrypt1``, ``unixcrypt5`` and ``unixcrypt6`` hashes. The computation is
283 performed by LemonLDAP::NG itself.
284 This does not require any action by the admin or users. Let us know if you
285 encounter regressions.
286
287 Portal templates changes
288 ~~~~~~~~~~~~~~~~~~~~~~~~
289
290 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
291
292 2.19.0
293 ------
294
295 RPM packaging
296 ~~~~~~~~~~~~~
297
298 RPM packages have been reorganized to match the Debian packages naming convention.
299 The upgrade via ``yum`` or ``dnf`` should work smoothly.
300
301 For EL8 and EL9, you must update the GPG key:
302
303 ::
304
305 curl https://lemonldap-ng.org/security/GPG-KEY-LLNG-SECURITY.asc > /etc/pki/rpm-gpg/RPM-GPG-KEY-OW2
306
307
308 Like Debian, jobs are now managed through systemd timers:
309
310 ::
311
312 systemctl edit lemonldap-ng-portal.timer
313 systemctl edit lemonldap-ng-handler.timer
314
315 Portal templates changes
316 ~~~~~~~~~~~~~~~~~~~~~~~~
317
318 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
319
320
321 2.18.2
322 ------
323
324 PKCE is enforced for all OIDC clients supporting it
325 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326
327 In versions before 2.18.2, PKCE was not verified doing the token request of an
328 OIDC flow unless the "Require PKCE" option was set explicitly in the
329 LemonLDAP::NG configuration for this RP.
330
331 Starting from now, PKCE will be verified anytime a RP enabled it by specifying
332 the ``code_challenge`` parameter during the authorization request.
333
334 RPs that do not support PKCE will not send the ``code_challenge`` parameter,
335 and therefore will not be affected by this change.
336
337 2.18.0
338 ------
339
340 "Stay connected" has changed name
341 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
342
343 The "Stay connected on this device" feature has been refactored into a more
344 generic :doc:`trustedbrowser` feature. The name of the configuration section
345 has changed in the manager but no particular actions are required for existing
346 installations.
347
348 Change in second factor UI
349 ~~~~~~~~~~~~~~~~~~~~~~~~~~
350
351 After registering a new second factor of type Webauthn, TOTP or Generic,
352 the user is now brought back to the main 2FA Management screen.
353 You can cancel this behavior by calling preventDefault in your JS handler:
354
355 .. code:: javascript
356
357 $(document).on( "mfaAdded", { }, function( event, info ) {
358 event.preventDefault();
359 });
360
361 See :doc:`jqueryevents` for more information
362
363 Apache2 handler now uses IP from mod_remoteip
364 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
365
366 If you use `mod_remoteip <https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html>`__ in your handlers,
367 LemonLDAP::NG will now correctly use the IP from ``mod_remoteip`` in
368 ``$env->{REMOTE_ADDR}``.
369
370 OpenID Connect issuer now implements ``acr_values``
371 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372
373 The `acr_values` from OpenID Connect authorization requests can now be used to increase the authentication level required for accessing a service. If after upgrading you start noticing that users are now asked to upgrade their session when trying to access OIDC applications, you should check the `acr_values` requested by you application, and map them to the desired authentication level in `OpenID Connect Service` » `Authentication context`
374
375 Cron files moved to systemd timers on Debian
376 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
377
378 On Debian, LemonLDAP::NG now uses systemd timers for maintenance tasks instead
379 of ``cron.d`` scripts.
380
381 If you need to modify the frequency of execution of your maintenance tasks, you should use a systemd override:
382
383 ::
384
385 systemctl edit liblemonldap-ng-portal-perl.timer
386 systemctl edit liblemonldap-ng-handler-perl.timer
387
388 ::
389
390 [Timer]
391 OnCalendar=*-*-* *:07:07
392
393
394 Encryption of password in session
395 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
396
397 If you store the password in session because you need to replay it on a protected application (Auth Basic or form replay),
398 you should now enable password encryption in session (this option is disabled by default).
399
400 This requires to decrypt the ``$_password``` value before sending it to the application, with the ``decrypt()`` method.
401
402 Safe Jail
403 ~~~~~~~~~
404
405 For security reason, we now enforce Safe Jail by default in lemonldap-ng.ini, so an administrator with only access to Manager
406 cannot disable it. If you want to improve security, update your lemonldap-ng.ini. To retrieve the old behavior (Safe Jail configuration
407 through Manager), just let the option commented in lemonldap-ng.ini.
408
409 Portal templates changes
410 ~~~~~~~~~~~~~~~~~~~~~~~~
411
412 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
413
414 2.17.1
415 ------
416
417 Restriction in use of OIDC `request_uri`
418 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
419
420 A little-know feature of OIDC (*note*: you are probably not using it) allows the OpenID Provider, LemonLDAP::NG in this case, to fetch the Authorization request parameters itself by indicating a `request_uri` parameter.
421
422 By default, we now disallow this feature, and require LemonLDAP::NG admins to explicitly allow Request URIs in the configuration (*OpenID Connect Relying Parties* » *Your RP* » *Options* » *Security* » *Allowed URLs for fetching Request Object*). This setting allows wildcards such as ``http://rp.example.com/*``.
423
424 2.17.0
425 ------
426
427 "Stay connected" now uses a TOTP challenge
428 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429
430 The :doc:`Stay connected on this device <trustedbrowser>` feature now relies on
431 a TOTP challenge. This means it only works if the client web browser is in
432 sync with the server. Existing sessions are not affected by this new
433 requirement.
434
435 Possible regression in unicode character handling for UWSGI users
436 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
437
438 We fixed an issue that made UWSGI behavior inconsistent with other deployment
439 methods (FastCGI, ApacheMP2). As a consequence, you might notice a change in
440 the way non-ASCII characters are displayed by LemonLDAP::NG.
441
442 If you used workarounds to make non-ASCII characters work in UWSGI, you can
443 remove them in this new release.
444
445 If you instead wish to restore previous behavior, you can also set the
446 following configuration in `/etc/uwsgi/apps-available/llng-server.yaml` :
447
448 .. code:: yaml
449
450 uwsgi:
451 # ...
452 env: LLNG_SKIPUTF8DOWNGRADE=1
453
454 However, restoring previous behavior is not recommended, as you are likely to run into
455 even more encoding bugs in the long run.
456
457
458 Portal templates changes
459 ~~~~~~~~~~~~~~~~~~~~~~~~
460
461 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
462
463 2.16.1
464 --------
465
466 AuthBasic now enforces 2FA activation
467 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
468
469 In previous versions of LemonLDAP::NG, a 2FA protected account didn't need to use their second factor when authenticating to an :doc:`AuthBasic handler <authbasichandler>`.
470
471 If you are *absolutely sure* that you want 2FA protected accounts to access AuthBasic handlers, which are password only, you can add the following test in your 2FA activation rules ::
472
473 and not $env->{AuthBasic}
474
475
476 2.0.16
477 ------
478
479 Security
480 ~~~~~~~~
481
482 Behaviour change in 2FA registration to avoid adding device without testing current authentication level.
483 (see `issue 2803 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2803>`__)
484 User must log in by using its higher available 2FA to register a new one.
485
486 Change in error messages
487 ~~~~~~~~~~~~~~~~~~~~~~~~
488
489 The error messages for the following situations have been changed:
490
491 .. csv-table::
492 :header: "Situation", "Translation code (lemonldap-ng.ini)", "Translation code (lang.json)", "New error message"
493 :delim: ,
494 :widths: auto
495
496 An authentication request has been made to an unknown CAS application,error_107,PE107,This application is not known
497 An authentication request has been made to an unknown SAML service provider,error_107,PE107,This application is not known
498 An authentication request has been made to an unknown OIDC relying party,error_107,PE107,This application is not known
499 User was not allowed to access a CAS application,error_84,PE84,You're not authorized to access to this host
500 An unauthorized logout URL was specified during logout from a CAS application,error_108,PE108,Unauthorized URL
501 An unauthorized Redirect URI was used during an OIDC login,error_108,PE108,Unauthorized URL
502 The provided url= parameter does not correspond to a protected URL,error_109,PE109,Not a protected or trusted URL
503
504 Users who wish to adjust error messages in these situations should update their translation files
505
506
507 Improve the use of multiple 2FA types
508 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
509
510 Changes in custom 2F::Register:: modules
511 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
512
513 * Users who use their own ``Lemonldap::NG::Portal::2F::Register::`` modules
514 must now inherit from ``Lemonldap::NG::Portal::2F::Register::Base``
515
516 * The `canUpdateSfa` function has been moved into the 2FA Engine and should not
517 be called by your registration module anymore
518
519
520
521 For plugin developpers
522 ~~~~~~~~~~~~~~~~~~~~~~
523
524 Change in ``passwordAfterChange`` hook behavior
525 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
526
527 If you wrote a custom plugin using the ``passwordAfterChange`` hook, return
528 codes other than ``PE_OK`` will now be displayed by the portal, instead of
529 being ignored.
530
531 Change in ``modifyPassword`` method
532 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
533
534 The ``modifyPassword`` method now takes a hash of arguments to specify extra behavior
535
536 Before:
537
538 .. code:: perl
539
540 # Method definition
541 sub modifyPassword {
542 my ( $self, $req, $pwd, $useMail ) = @_;
543 ...
544 }
545
546 # Method call
547 $self->p->_passwordDB->modifyPassword($req, $pwd, $useMail);
548
549 After:
550
551 .. code:: perl
552
553 # Method definition
554 sub modifyPassword {
555 my ( $self, $req, $pwd, %args ) = @_;
556 my $useMail = $args{useMail};
557 ...
558 }
559
560 # Method call
561 $self->p->_passwordDB->modifyPassword($req, $pwd, useMail => $useMail);
562
563 2.0.15
564 ------
565
566 Translation overrides in lemonldap-ng.ini now take priority over skin
567 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
568
569 Previously, the presence of a translation JSON file within a skin prevented
570 translation messages defined in ``lemonldap-ng.ini`` from being used.
571
572 Additionally, it was not possible to translate strings in email templates using
573 a custom skin file.
574
575 These two bugs are now fixed, be sure to check that you do not have duplicate
576 translations in ``lemonldap-ng.ini`` and in your skin files (``*.json``). If you do,
577 the translation in ``lemonldap-ng.ini`` will now take priority.
578
579 See :ref:`documentation on translating messages <intlmessages>` for
580 details
581
582 Portal templates changes
583 ~~~~~~~~~~~~~~~~~~~~~~~~
584
585 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
586
587 2.0.14
588 ------
589
590 Security
591 ~~~~~~~~
592
593 * **CVE-2021-40874**: RESTServer pwdConfirm always returns true with Combination + Kerberos (see `issue 2612 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2612>`__)
594
595
596 U2F deprecation in Chrome 98
597 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
598
599 Chrome 98 `removed U2F support by default <https://developer.chrome.com/blog/deps-rems-95/#deprecate-u2f-api-cryptotoken>`__. You can enable them back temporarily in ``chrome://flags`` by setting *Enable the U2F Security Key API* to *Enabled* and *Enable a permission prompt for the U2F Security Key API* to *Disabled*
600
601 LemonLDAP::NG provides a newer alternative: :doc:`webauthn2f`, which is compatible with U2F security keys. Please read :ref:`migrateu2ftowebauthn` for instructions on how to convert U2F secrets to WebAuthn.
602
603 After migration, you will need to disable U2F from the configuration and enable WebAuthn instead, in *General Parameters* » *Second Factors* » *WebAuthn*
604
605 Weak encryption used for password-protected SAML keys
606 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
607
608 Previous versions of LemonLDAP::NG used a weak encryption algorithm to protect
609 SAML keys when a password was set during certificate generation.
610
611 Run the following command to check if this is your case::
612
613 lemonldap-ng-cli get samlServicePrivateKeySig
614 lemonldap-ng-cli get samlServicePrivateKeyEnc
615
616 If the output of either command starts with ``BEGIN ENCRYPTED PRIVATE KEY``,
617 then it probably means you generated your keys using the vulnerable manager
618 code.
619
620 In this case, you can convert your existing keys to a stronger encryption using
621 the following command ::
622
623 # Extract your existing keys. If samlServicePrivateKeyEnc is empty, you can
624 # skip it entirely
625 lemonldap-ng-cli get samlServicePrivateKeySig | \
626 sed 's/samlServicePrivateKeySig = //' > saml-sig.pem
627 lemonldap-ng-cli get samlServicePrivateKeyEnc | \
628 sed 's/samlServicePrivateKeyEnc = //' > saml-enc.pem
629
630 # Re-encrypt the private key, using the same passphrase
631 openssl pkey -in saml-sig.pem -aes256 -out saml-sig-aes.pem
632 openssl pkey -in saml-enc.pem -aes256 -out saml-enc-aes.pem
633
634 #Or, if you are using OpenSSL 3+
635 openssl pkey -provider legacy -provider default -in saml-sig.pem \
636 -aes256 -out saml-sig-aes.pem
637 openssl pkey -provider legacy -provider default -in saml-enc.pem \
638 -aes256 -out saml-enc-aes.pem
639
640 Then, simply reimport your keys ::
641
642 lemonldap-ng-cli set samlServicePrivateKeySig "$(cat saml-sig-aes.pem)"
643 lemonldap-ng-cli set samlServicePrivateKeyEnc "$(cat saml-enc-aes.pem)"
644
645 If is recommended to keep the same password as before, if not, adjust the
646 ``samlServicePrivateKeySigPwd`` and ``samlServicePrivateKeyEncPwd`` variables as well.
647
648 This operation is transparent and does not require any change to your existing
649 SAML configuration or SAML applications
650
651 LemonLDAP::NG version is returned by the CheckState plugin
652 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
653
654 If you use the `/checkstate` URL to monitor LemonLDAP::NG, you may notice a slight change in the output format:
655
656 *2.0.13* ::
657
658 {"result":1}
659
660 *2.0.14* ::
661
662 {"result":1,"version":"2.0.14"}
663
664 Depending on your load balancer or monitoring configuration, this can cause false negatives.
665
666 This plugin is disabled by default, and you may use a shared secret to hide this information to regular users and bots, please check the :doc:`checkstate` documentation for more information.
667
668 Empty scopes now rejected in OAuth2.0 grants
669 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
670
671 Previously, it was possible to be granted an empty scope, or an automatic
672 ``openid`` scope when doing :ref:`OAuth2.0 Password Grant
673 <resource-owner-password-grant>` or :ref:`Client Credentials Grant
674 <client-credentials-grant>`.
675
676 Starting with *2.0.14*, empty scopes are no longer allowed (:rfc:`6749#section-3.3`).
677 You need to either add a `scope` parameter to your request, or define a default
678 scope in your Relying Party's :ref:`Scope Rules <oidcscoperules>`.
679
680 Manager API
681 ~~~~~~~~~~~
682
683 The service parameter set in a request to create or update a CAS application must now be an array, and no more a string.
684
685 Changes impacting plugin developpers
686 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
687
688 * If you are using Custom authentication modules, userDB modules or password
689 modules, ``$portal->loadedPlugins`` no longer contains a key with the name of
690 your module. You should use ``$portal->_authentication``, ``$portal->_userDB``,
691 or ``$portal->_passwordDB`` instead to get your module instance.
692
693 Portal templates changes
694 ~~~~~~~~~~~~~~~~~~~~~~~~
695
696 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
697
698
699
700 2.0.13
701 ------
702
703 Portal templates changes
704 ~~~~~~~~~~~~~~~~~~~~~~~~
705
706 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
707
708 2.0.12
709 ------
710
711 Security
712 ~~~~~~~~
713
714 * **CVE-2021-35473**: Access token lifetime is not verified with OAuth2 Handler (see `issue 2549 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2549>`__)
715 * **CVE-2021-35472**: Session cache corruption can lead to authorization bypass or spoofing (see `issue 2539 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2539>`__)
716 * 2FA bypass with sfOnlyUpgrade and totp2fDisplayExistingSecret (see `issue 2543 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2543>`__)
717 * Incorrect regexp construction in isTrustedUrl lets attacker steal session on CDA application (see `issue 2535 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2535>`__)
718 * XSS on register form (see `issue 2495 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2495>`__)
719 * Wildcard in virtualhost allows being redirected to untrusted domains (see `issue 2477 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2477>`__)
720
721 Client Credential sessions missing expiration time
722 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
723
724 If you started using Client Credential grants in 2.0.11, you may have encountered
725 `issue 2481 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2481>`__.
726
727 Because of this bug, the created sessions may never be purged by the ``purgeCentralCache`` script.
728
729 In order to detect these sessions, you can run the following command:
730
731 ::
732
733 lemonldap-ng-sessions search --where _session_kind=SSO --select _session_id --select _utime | \
734 jq -r '. | map(select(._utime == null)) | map(._session_id) | join ("\n")'
735
736 This will output a list of SSO sessions with no expiration time.
737
738 Review them manually using ::
739
740 lemonldap-ng-sessions get <session_id>
741
742 You can then remove them with ::
743
744 lemonldap-ng-sessions delete <session_id> <session_id> <etc.>
745
746 Brute-force protection plugin may cause duplicate persistent sessions
747 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
748
749 Because of `bug #2482 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2482>`__ , some users may notice that the persistent session database is filling with duplicate sessions. Some examples include:
750
751 * An uppercase version of the regular persistent session (dwho vs DWHO)
752 * An unqualified version (dwho vs [email protected])
753
754 This bug was fixed in 2.0.12, but administrators are advised to clean up their persistent session database to remove any duplicate persistent sessions remaining after the upgrade.
755
756 OpenID Connect check session iframe
757 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
758
759 The OIDC check session iframe is not working, it has been removed from OIDC configuration metadata. It should not impact any installation as this feature was already broken.
760
761 Simplification of TOTP options
762 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
763
764 The following options have been removed from TOTP configuration:
765
766 * Display existing secret (``totp2fDisplayExistingSecret``)
767 * Change existing secret (``totp2fUserCanChangeKey``)
768
769 Portal templates changes
770 ~~~~~~~~~~~~~~~~~~~~~~~~
771
772 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
773
774
775 2.0.11
776 ------
777
778 Portal templates changes
779 ~~~~~~~~~~~~~~~~~~~~~~~~
780
781 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
782
783 2.0.10
784 ------
785
786 Security
787 ~~~~~~~~
788
789 A vulnerability affecting LemonLDAP::NG installations has been found out when ALL following criteria apply:
790
791 * Your handler server uses Nginx
792 * Your virtual host configuration contains per-URL ``skip`` or ``unprotect`` access rule
793
794 In this situation, you have to update your LUA configuration file like ``/etc/nginx/nginx-lua-headers.conf``. See also `issue 2434 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2434>`__.
795
796 Other minor security fixes:
797
798 * It is now possible to hide sessions identifier in Manager (parameter ``displaySessionId``). See also `issue 2350 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2350>`__.
799 * Second factor management by end user now requires safer conditions. See also `issue 2332 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2332>`__, `issue 2337 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2337>`__ and `issue 2338 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2338>`__.
800
801 Main changes
802 ~~~~~~~~~~~~
803
804 - New dependency: IO::Socket::Timeout
805 - TOTP check tolerates forward AND backward clock drift (totp2fRange)
806 - Avoid assignment in expressions option is disabled by default
807 - RHEL/CentOS SELinux users should install the new ``lemonldap-ng-selinux`` package to fix `an issue with the new default cache directory <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2401>`__
808 - If you use :doc:`applications/mattermost` with OpenID Connect, you need to set the ``id`` claim type to *Integer*
809 - BruteForceProtection plugin now prevents authentication on backend if an account is locked
810 - In the Manager API, postLogoutRedirectUri is now `returned and consumed as an array <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2347>`__
811 - We fixed a bug that caused SAML sessions to be created and never deleted, you should check your session databases for sessions that have ``"_session_kind": "ISAML"`` but no ``_utime``. You can safely delete SAML sessions with no ``_utime`` during the upgrade.
812
813 Portal templates changes
814 ~~~~~~~~~~~~~~~~~~~~~~~~
815
816 If you modified some non-custom HTML templates, :doc:`refer to template upgrade instructions<upgrade_templates>`
817
818 2.0.9
819 -----
820
821 - Bad default value to display OIDC Consents tab has been fixed.
822 The default value is now: ``$_oidcConsents && $_oidcConsents =~ /\w+/``
823 - Some user log messages have been modified, check :doc:`logs documentation <logs>`
824 (see also `#2244 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/2244>`__)
825 - SAML SOAP calls are now using ``text/xml`` instead of ``application/xml`` as the MIME Content Type, as required by `the SOAP standard <https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383526>`__
826 - Incremental lock times values can now be set in BruteForceProtection plugin through Manager.
827 It MUST be a list of comma separated values. Default values are ``5, 15, 60, 300, 600``
828 - This version is not compatible with :doc:`applications/mattermost`
829
830 Cookie issues with Chrome
831 ~~~~~~~~~~~~~~~~~~~~~~~~~
832
833 This release fixes several issues related to the change in SameSite cookie
834 policy for Google Chrome users. The new default value of the SameSite
835 configuration parameter will set SameSite to ``Lax`` unless you are using SAML,
836 in which case it will be set to ``None``.
837
838 This means that from now on, any LemonLDAP::NG installation using SAML must be
839 served over HTTPS, as SameSite ``None`` value requires the ``Secure`` flag in cookie.
840
841 Change in default cache directory
842 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
843
844 The default config/session cache directory has been moved from ``/tmp`` to
845 ``/var/cache/lemonldap-ng`` in order to avoid `issues with cache purges
846 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2254>`__ when using
847 Systemd. This change is only applied to new installations. If your
848 installation is experiencing cache purge issues, you need to manually change
849 your existing ``localSessionStorageOptions/cache_root`` parameter from ``/tmp``
850 to ``/var/cache/lemonldap-ng``. Be sure to create this directory on your
851 file system before modifying your configuration.
852
853 If you are using SELinux, you also need to run the following commands ::
854
855 semanage fcontext --add -t httpd_cache_t -f a '/var/cache/lemonldap-ng(/.*)?'
856 restorecon -R /var/cache/lemonldap-ng/
857
858 Required changes in NGINX handler rules (CVE-2020-24660)
859 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
860
861 We discovered a vulnerability that affects LemonLDAP::NG installations when ALL of the following criteria apply:
862
863 * You are using the :doc:`LemonLDAP::NG Handler<configvhost>` to protect applications
864 * Your handler server uses Nginx
865 * Your virtual host configuration contains per-URL access rules based on
866 regular expressions in addition to the built-in *default* access rule.
867
868 .. note::
869
870 You are safe from this vulnerability if your virtualhost only uses a regexp-based rule to trigger logout
871
872 If you are in this situation, you need to modify *all* your handler-protected
873 virtualhosts by making the following change:
874
875 * Replace ``fastcgi_param X_ORIGINAL_URI $request_uri`` by ``fastcgi_param X_ORIGINAL_URI $original_uri`` if you are using FastCGI
876 * Replace ``uwsgi_param X_ORIGINAL_URI $request_uri`` by ``uwsgi_param X_ORIGINAL_URI $original_uri`` if you are using uWSGI
877 * Right after ``auth_request /lmauth;``, add the following line ::
878
879 set $original_uri $uri$is_args$args;
880
881 You can check the :doc:`configvhost` page for more information
882
883 LDAP certificate validation (CVE-2020-16093)
884 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
885
886 LDAP server certificates were previously not verified by default when using secure transports (LDAPS or TLS), see `CVE-2020-16093 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/issues/2250>`__. Starting from this release, certificate validation is now enabled by default, including on existing installations.
887
888 If you have configured your CA certificates incorrectly, LemonLDAP::NG will now start complaining about invalid certificates. You may temporarily disable it again with the following command ::
889
890 /your/path/to/lemonldap-ng-cli set ldapVerify none
891
892 If you use LDAP as a configuration storage, and want to temporarily disable certificate validation, you must make the following addition to `/etc/lemonldap-ng/lemonldap-ng.ini` ::
893
894 [configuration]
895 ...
896 ldapVerify = none
897
898 If you use LDAP as a session backend, you are strongly encouraged to also upgrade corresponding ``Apache::Session`` modules (``Apache::Session::LDAP`` or ``Apache::Session::Browseable``). After this upgrade, if you want to temporarily disable certificate validation, you can add the following parameter to the list of Apache::Session module options:
899
900 * key: ``ldapVerify``
901 * value: ``none``
902
903 Please note that it is HIGHLY recommended to set certificate validation to `require` when contacting LDAP servers over a secure transport to avoid man-in-the-middle attacks.
904
905 2.0.8
906 -----
907
908 - New dependency: Perl module Time::Fake is now required to run unit
909 test and build packages, but should not be mandatory to run the
910 software.
911 - Nginx configuration: some changes are required to allow IPv6, see
912 `#2152 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/2152>`__
913 - Option ``singleSessionUserByIP`` was removed, see
914 `#2159 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/2159>`__
915 - A memory leak was found in perl-fcgi with Perl < 5.18, a workaround
916 is possible with Apache and llng-fastcgi-server, see
917 `#1314 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/1314>`__
918
919 - With Apache: set ``FcgidMaxRequestsPerProcess 500`` in portal
920 virtual host
921 - With llng-fastcgi-server: set ``PM_MAX_REQUESTS=500`` in
922 llng-fastcgi-server service configuration
923
924 - Cookie ``SameSite`` value: to avoid problems with recent browsers,
925 SAML POST binding, LLNG cookies are now tagged as
926 "**SameSite=None**". You can change this value using manager,
927 "**SameSite=Lax**" is best for installations without federations.
928 **Important note**: if you're using an unsecured connection *(http://
929 instead of https://)*, "SameSite=None" will be ignored by browsers
930 and users that already have a valid session might be prompted to
931 login again.
932 - OAuth2.0 Handler: a VHost protected by the OAuth2.0 handler will now
933 return a 401 when called without an Access Token, instead of
934 redirecting to the portal, as specified by
935 :rfc:`6750#section-3`.
936
937 - If you encounter the following issue:
938
939 ::
940
941 AH01630: client denied by server configuration: /usr/share/lemonldap-ng/manager/api/api.fcgi
942
943 when trying to access the portal. It probably comes from incorrect
944 Apache configuration. Remove the (optional and disabled by default)
945 manager API config:
946
947 ::
948
949 rm /etc/httpd/conf.d/z-lemonldap-ng-api.conf && systemctl reload httpd
950
951 2.0.7
952 -----
953
954 - Security:
955
956 - `#2040 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/2040>`__:
957 Configuration of a redirection URI for an OpenID Connect Relying
958 Party is now mandatory, as defined in the specifications. If you
959 save your configuration, you will have an error if some of your RP
960 don't have a redirect URI configured.
961 - `#1943 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/1943>`__
962 /
963 `CVE-2019-19791 <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19791>`__:
964 along with the patch provided in 2.0.7 in
965 ``Lemonldap/NG/Common/PSGI/Request.pm``, Apache rewrite rule must
966 be updated to avoid an unprotected access to REST services:
967
968 ::
969
970 portal-apache2.conf
971
972 .. code-block:: apache
973
974 RewriteCond "%{REQUEST_URI}" "!^/(?:(?:static|javascript|favicon).*|.*\.fcgi(?:/.*)?)$"
975 RewriteRule "^/(.+)$" "/index.fcgi/$1" [PT]
976
977 ::
978
979 manager-apache2.conf
980
981 .. code-block:: apache
982
983 RewriteCond "%{REQUEST_URI}" "!^/(?:static|doc|lib|javascript|favicon).*"
984 RewriteRule "^/(.+)$" "/manager.fcgi/$1" [PT]
985
986 - Other:
987
988 - Option ``checkTime`` was enabled by default in
989 ``lemonldap-ng.ini``, this let the portal check the configuration
990 immediately instead of waiting for configuration cache expiration.
991 You can keep this option enabled unless you need strong
992 :doc:`performances<performances>`.
993
994 - Removed parameters:
995
996 - ``samlIdPResolveCookie``
997
998 2.0.6
999 -----
1000
1001 - Option was added to display generate password box in
1002 :doc:`password reset by mail plugin<resetpassword>`. If you use this
1003 feature, you must enable this option, which is disabled by default.
1004 - If you use the default \_whatToTrace macro and a case insensitive
1005 authentication backend, then a user can generate several persistent
1006 sessions for the same login (see `issue
1007 1869 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/1869>`__).
1008 This can lead to a security bug if you enabled 2FA, which rely on
1009 data stored in the persistent session. To fix this, either choose a
1010 unique attribute for \_whatToTrace, either force lower case in your
1011 macro:
1012
1013 .. code-block:: perl
1014
1015 $_auth eq 'SAML' ? lc($_user.'@'.$_idpConfKey) : $_auth eq 'OpenIDConnect' ? lc($_user.'@'.$_oidc_OP) : lc($_user)
1016
1017 - On CentOS 7 / RHEL 7, a system upgrade breaks ImageMagick, which is
1018 used to display captchas (see
1019 `#1951 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/1951>`__).
1020 To fix this, you can run the following commands:
1021
1022 ::
1023
1024 yum install -y urw-base35-fonts-legacy
1025 sed 's,/usr/share/fonts/default/Type1/,/usr/share/X11/fonts/urw-fonts/,g' -i /etc/ImageMagick/type-ghostscript.xml
1026
1027 2.0.5
1028 -----
1029
1030 - The Text::Unidecode perl module becomes a requirement *(it will be
1031 automatically installed if you upgrade from from the deb or RPM
1032 repositories)*
1033 - CAS logout starts validating the service= parameter, but only if you
1034 use the CAS Access control policy. The URL sent in the service=
1035 parameter will be checked against
1036 :ref:`known CAS applications<idpcas-configuring-cas-applications>`,
1037 Virtual Hosts, and
1038 :ref:`trusted domains<security-configure-security-settings>`. Add
1039 your target domain to trusted domains if you suddenly start having
1040 "Invalid URL" messages on logout
1041 - Improvements in cryptographic functions: to take advantage of them,
1042 **you must change the encryption key** of LemonLDAP::NG (see
1043 :ref:`CLI example<cli-examples-encryption-key>`).
1044 - Debian packaging: FastCGI / uWsgi servers require llng-lmlog.conf and
1045 llng-lua-headers.conf. Those configuration files are now provided by
1046 lemonldap-ng-handler package and installed in /etc/nginx/snippets
1047 directory.
1048
1049 Upgrading from 2.0.0 or 2.0.1 to later versions
1050 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1051
1052 If you have :doc:`installed LemonLDAP::NG from official RPMs<installrpm>`, you
1053 may run into bug `#1757
1054 <https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/1757>`__ and lose your
1055 Apache configuration files while updating from LemonLDAP::NG 2.0.0 or 2.0.1 to
1056 later versions. Please backup your ``/etc/httpd/conf.d/z-lemonldap-ng-*.conf``
1057 files before the update.