From: "cron2 (Code Review)" Date: Sat, 26 Oct 2024 09:16:15 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <44a847f3429a617addd56111e5526820ab7deb5a-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="QECv0oxJfSQ="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Refuse clients if username or password is > USER_PASS_LEN List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --QECv0oxJfSQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/787?usp=3Demail ) Change subject: Refuse clients if username or password is > USER_PASS_LEN ...................................................................... Patch Set 1: Code-Review-2 (1 comment) Patchset: PS1: This is not working right for me. I have a client, built with PKCS11 support, that sends a 230 byte username = and a short passwort (11 characters). On the server side (not built with P= KCS11, verified by printing out USER_PASS_LEN at startup), this is using pl= ugin-auth-pam, and it seems to happily pass things onward, in confusing ways ``` 2024-10-26 11:10:24 USER_PASS_LEN=3D128 ... Oct 26 11:06:47 gentoo tun-udp-p2mp-global-authpam[1709]: 194.97.140.21:502= 80 TLS INFO: Username (128) or password (103) long Oct 26 11:06:47 gentoo tun-udp-p2mp-global-authpam[1709]: PLUGIN AUTH-PAM: = deferred authentication Oct 26 11:06:47 gentoo tun-udp-p2mp-global-authpam[1709]: 194.97.140.21:502= 80 TLS: Username/Password authentication deferred for username 'ThisUserNam= eIsTooLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReally_Th= isUserNameIsTooLongReally_ThisUserNameIsT' ``` so it's not overrunning the buffer, and not getting confused anymore, but i= t *is* truncating the username to 128 bytes and using "the rest" for the pa= ssword (103 =3D (230-128). Turning on password logging in plugin-auth-pam = confirms: ``` Oct 26 11:06:47 gentoo openvpn[1711]: PLUGIN AUTH-PAM: BACKGROUND: USER/PAS= S: ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsTo= oLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsT/ooLongReally_ThisUs= erNameIsTooLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReal= ly_230ch ``` (the password the client sends is `totallysecret`, and the client username = ends in `_230ch`) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/787?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I60f02c919767eb8f1b95253689a8233f5f68621d Gerrit-Change-Number: 787 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Sat, 26 Oct 2024 09:16:15 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --QECv0oxJfSQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

Patch set 1:Code-Review -2=

Vi= ew Change

1 comment:

  • Patchset:

    • Patch Set #1:

      This is not working right for me.

      I have a client, built w= ith PKCS11 support, that sends a 230 byte username and a short passwort (11= characters). On the server side (not built with PKCS11, verified by print= ing out USER_PASS_LEN at startup), this is using plugin-auth-pam, and it se= ems to happily pass things onward, in confusing ways

      ```
      2024-10-26 11:10:24 USER_PAS= S_LEN=3D128
      ...
      Oct 26 11:06:47 gentoo tun-udp-p2mp-global-authpam[17= 09]: 194.97.140.21:50280 TLS INFO: Username (128) or password (103) longOct 26 11:06:47 gentoo tun-udp-p2mp-global-authpam[1709]: PLUGIN AUTH-PAM= : deferred authentication
      Oct 26 11:06:47 gentoo tun-udp-p2mp-global-aut= hpam[1709]: 194.97.140.21:50280 TLS: Username/Password authentication defer= red for username 'ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReal= ly_ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsT&= #39;
      ```

      = so it's not overrunning the buffer, and not getting confused anymore, b= ut it *is* truncating the username to 128 bytes and using "the rest&qu= ot; for the password (103 =3D (230-128). Turning on password logging in pl= ugin-auth-pam confirms:

      ```
      Oct 26 11:06:47 gentoo openvpn[1711]: PLUGIN AUTH-PAM: BA= CKGROUND: USER/PASS: ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReall= y_ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsT/o= oLongReally_ThisUserNameIsTooLongReally_ThisUserNameIsTooLongReally_ThisUse= rNameIsTooLongReally_230ch
      ```

      (the password the client sends is `totallysecret`, and= the client username ends in `_230ch`)

To view, v= isit chan= ge 787. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I60f02c919767eb8f1b95253689a= 8233f5f68621d
Gerrit-Change-Number: 787
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Sat, 26 Oct 2024 09:16:15= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--QECv0oxJfSQ=--