Announcement

Collapse
No announcement yet.

Copied-&-pasted WiFi password containing trailing Carriage Return crashed the profile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Copied-&-pasted WiFi password containing trailing Carriage Return crashed the profile

    I was trying to connect to one of my home WiFi and, doing so, I simply copied-and-pasted my complicated password from the cell of my spreadsheet (LibreCalc) onto the text-box of password of the Network menu pop-out from the System Tray area.

    However, the text-box not only accepted normal characters, but also control characters (whitespaces) that are invisible including the trailing Carriage Return as I copied from the cell of the spreadsheet. It was difficult to notice visually, not only because the text-box was by default masked, but also the control characters are all invisible.

    The attempt of connection failed, because of incorrect password. And, information of such WiFi SSID has been automatically remembered and a profile was respectively created.

    Then, I realised the problem might be because of the copied trailing Carriage Return, so I tried to change the password through the Configure Network Connections screen, but whatever way I tried through any screen, the connection never get success.

    I suspected that the Carriage Return control character allowed by the text-box has somewhat screwed up my WiFi profiles configuration, which would possibly a bug and potential security issue for KUbuntu.

    The issue is simple and easily reproducible, but please don't try on your actual system or it would definitely ruin your WiFi profile causing you failed to connect to such particular SSID forever. You may try on a Virtual Machine system.

    Does anyone know how to fix this? Do I need to fix the underlying configuration file(s) that might have became problematic?

    Many thanks.
    Last edited by clement; Mar 03, 2022, 03:17 AM.

    #2
    Maybe try deleting the ssid altogether, and re-adding it?

    I will imagine copying text from a spreadsheet will include much more than carriage returns, depending on how it was copied, as you are copying a cell as opposed to just the text in it. Formatting and other data as well. If you simply highlight the text, it probably copies correctly.
    Or double click the cell, then copy/paste iirc.

    Comment


      #3
      I copy and paste my passwords from a text file.

      Comment


        #4
        Originally posted by claydoh View Post
        Maybe try deleting the ssid altogether, and re-adding it?

        I will imagine copying text from a spreadsheet will include much more than carriage returns, depending on how it was copied, as you are copying a cell as opposed to just the text in it. Formatting and other data as well. If you simply highlight the text, it probably copies correctly.
        Or double click the cell, then copy/paste iirc.
        Thanks for your suggestion.

        I did try whatever ways I could via GUI screens, like having deleted the remembered SSID through the Configure Network Connections screen before connecting it as fresh new SSID. Unfortunately, all of my attempts were of no avail.

        I suspected that something like configuration or credential file(s) was/were generated, and was/were being in a corrupted state, that could not be properly managed by the procedure, or programming logic, governed by and through GUI screens if happened with a case that user inputted password with a Carriage Return.

        I even tried inspecting all
        Code:
        *.nmconnection
        files at [
        Code:
        /etc/NetworkManager/system-connections/
        ] and, by comparing the files with other good SSID ones.

        I did found that the file associated with my SSID was truly corrupted containing anomalous structure (some important attributes are missing). I fixed the problematic one of my SSID. Unfortunately, again, still of no avail, perhaps something more to fix.

        I have no knowledge about how does the WiFi work and what files are physically used by KUbuntu in filesystem regarding WiFi management.

        I wanted myself to understand of how KUbuntu manages WiFi and tried to find relevant documentations to study, but seemed that they are hard to search.

        Would appreciate anyone got any ideas.

        Comment


          #5

          Passwords are normally stored in Kwallet in Plasma, similar to Gnome's keyring, but can be stored in the nmconnection file, if one has changed this via settings.
          You can see the info in System Settings, under Kwallet >> Launch Wallet Manager >> Network Management >> maps

          You should be able to inspect and delete the password entry if it is wrong, or probably better, the whole upper level UUID that represents the connection(right-click). Maybe there was a disconnect between networkmanager and the wallet.

          Comment


            #6
            Originally posted by claydoh View Post
            Passwords are normally stored in Kwallet in Plasma, similar to Gnome's keyring, but can be stored in the nmconnection file, if one has changed this via settings.
            You can see the info in System Settings, under Kwallet >> Launch Wallet Manager >> Network Management >> maps

            You should be able to inspect and delete the password entry if it is wrong, or probably better, the whole upper level UUID that represents the connection(right-click). Maybe there was a disconnect between networkmanager and the wallet.
            Having followed through your suggested steps to access the “maps” of the KWallet's Network Management, the “psk” of my problematic SSID “shown” on such GUI screen is fine without any Carriage Return.

            So, probably the problematic bit(s) is/are elsewhere awaiting our further investigation.

            Cheers.

            Comment


              #7
              I have zero ideas,
              I even tried to replicate what you did, with no ill effects, other than that SSID disappearing from the tray applet. Deleting it from System Settings fixed that, and things went back to normal in the tray applet, with the SSID reappearing, and I could enter my password and log in as expected.

              Have you tried creating a new WiFi connection in System Settings? You can have multiple connections profiles for any device, including wifi SSIDs, with different names.
              Did you try deleting the .nmconnection file associated with the connection, assuming it still exists? It shouldn't be present if you have deleted it via System Settings.

              Comment


                #8
                Thanks a lot claydoh for replicating my case on your system. Fortunately that all went well on yours and didn't screwed yours.

                I have no idea either. I did try all steps your suggested, including the last one, to deliberately create a new WiFi connection in the System Settings. The result was, again, failed to connect such SSID. My WiFi password was simply printable characters [ https://en.wikipedia.org/wiki/ASCII#...ble_characters ].

                But, this time, I discovered something weird. I did pay attention to the notification pop-out from the System Tray after deleting the SSID connection, which was unnoticed by me before, could give us some hints.

                Whatever SSID connection I deleted, i.e. including the good ones, via the “Connections — System Settings Module” which is accessible via clicking the “Configure Network Connections...” from System Tray, all notifications of deletion consistently saying “Failed to remove {NEW-LINE} {SSID} {NEW-LINE} Error checking authorization: connection was deleted.” But, I found that the SSID I intended to delete did disappear from the “Connections — System Settings Module” as well as the KWallet. So, It seems to me that the SSID has been successfully deleted, at least from visually on the GUI screens.

                Click image for larger version

Name:	Network Management --- Failed to remove --- {SSID} --- Error checking authorization: connection was deleted.png
Views:	151
Size:	27.3 KB
ID:	661153

                Any idea then? Hope it helps us investigating. Cheers.

                Comment


                  #9
                  Is the *.nmconnection file still present in /etc/NetworkManager ? Did you try deleting this(you'd need the command line to do so)
                  Was the new connection created using a different name from the actual SSID name?? Even "New Wireless Connection" (the default name) might work, creating a different .nmconnection file.


                  Your last bug seems to be a very sporadic one, not specific to any desktop or distro, though the few reports I have seen are not similar toy yours.

                  Comment


                    #10
                    Yes, after I deleted the SSID Connection via the “Connections — System Settings Module”, the associated *.nmconnection file did went away itself automatically.

                    Good suggestion for creating a different Connection name from the actual SSID name. I tried it. Unfortunately, no luck goes with me. The connection to such SSID remains unsuccessful even under with a customised, new Connection name.

                    A bit background about why I needed to persist finding out root cause (bug) and solution, but not simply changing the WiFi SSID myself:

                    I am living in a large shared apartment, the WiFi (router) is administrated by the owner and the Internet is being used by many residents.

                    So, I have no points and no rights, as a tenant, to request a change of WiFi SSID just for fixing my case without affecting others.

                    I can still connect to a slower-speed 2.4GHz WiFi signal, but the problematic one, which screwed up with my system, is a faster-speed 5GHz one.

                    I'm going to give up trying, but would really appreciate if you, or anyone, get any idea for diagnosis and resolving the problem.

                    My PC is KUbuntu 20.04 freshly installed. So, that's why I needed to re-connect the WiFi and provided password to the system.

                    Lastly, I would suggest the developers of KUbuntu, or that of KDE in particular, revise the text-box of password of the WiFi Network menu pop-out from the System Tray to accepting only printable characters [ https://en.wikipedia.org/wiki/ASCII#...ble_characters ].

                    Really apperciate claydoh for your assistance!!

                    Comment


                      #11
                      Apologies in advance if I'm simply missing something, but a user entering an incorrect Wi-Fi password simply should not be a huge problem, nor should it in any way involve another person resetting the real password.

                      I don't see why simply deleting the bad entry/connection/password and starting over won't solve the problem. You can even try creating a new user and logging in with it. See if you can connect to Wi-Fi normally, using its real password (and NOT copied/pasted from a spreadsheet!). Try that and let us know what happens. Then we can help sort out what to do next.

                      Bottom line is that *you* at your end should be able to fix this, without ever involving the person who administers the router, and without worrying about those weird characters that got pasted in.
                      Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

                      Comment

                      Working...
                      X