[MDEV-10361] auth_pam + RSA SecurID PAM module + SQLyog causes server crash Created: 2016-07-11 Updated: 2020-08-25 Resolved: 2018-03-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Plugin - pam |
| Affects Version/s: | 10.1.10 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Georg Richter |
| Resolution: | Not a Bug | Votes: | 4 |
| Labels: | pam | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
A user saw the following server crash in auth_pam when connecting to MariaDB server using SQLyog, which is linked with MariaDB Connector/C:
RSA SecurID implements multi-factor authentication. The crash seems to occur when SQLyog attempts to automatically reconnect with the user's previously-entered PIN, which was only intended for 1 use. This might indicate a bug in the RSA SecurID PAM module. This one looks similar: https://www.redhat.com/archives/pam-list/2015-April/msg00003.html |
| Comments |
| Comment by Elena Stepanova [ 2016-07-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
serg, would you look at this? I don't know if serg will need any of this, but here are first questions that came to my mind after seeing this:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
The crash happened several times.
The user was trying to log in to a MariaDB server from SQLyog using a user account that is configured to use PAM authentication. I have asked the user to clarify if the crash happens every time the user logs in with that user account from SQLyog. I have also asked the user if pam_use_cleartext_plugin is enabled on the server. If SQLyog doesn't support the dialog plugin, could that lead to crashes? I will try to get more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The crash is happening, as you can see, not in auth_pam, but in pam_securid.so pam module. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
It does appear so. I believe the intention is to use some kind of RSA token in addition to passwords to authenticate DBA user accounts. Here's the PAM policy for the user's MariaDB server:
And pam_use_cleartext_plugin is turned OFF. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We've had a similar case before. A user was complaining about a crash, in pam_fprintd.so, if I'm not mistaken. It turned out that this particular PAM module was not safe for concurrent use, so when many users tried to connect (and authenticate) at the same time, it crashed. In that case, though, the user did not want to authenticate database users with fingerprints, he simply reused some global policy file. So the workaround was to remove pam_fprintd.so from MariaDB PAM policy. It looks like pam_securid.so is the reason here, too. But I don't know if it's concurrency or something else that triggers the crash. Do you know how to cause the crash? Is it deterministic? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
The user says that the server crashes every time that they try to authenticate with an account configured to use an RSA token, but I am trying to get him to clarify if the crash happens when connecting from any client, or just when connecting from SQLyog. I've also attached /var/log/messages from the user's server. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The user clarified that it does work without crashing when connecting with the mysql command-line client. So far, it only seems to crash when connecting via SQLyog. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The user's version of pam_securid.so:
This version looks like it might be kind of old, based on the versions listed here: I've asked the user to try upgrading. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-07-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If the problem is indeed in the module, I'm not sure the upgrade will help – I've seen a similar complaint about 7.1.0.1: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks like you were right about that. The user upgraded to this version:
But it still crashed:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-07-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There isn't much I can do without RSA SecurID token and SQLyog. I can, I suppose, build a debugging version of auth_pam module that logs all the data to a file and then to try to analyze the differences between SQLyog and mysql cli cases. Note that this log might contain passwords and other sensitive data. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Since elenst found record of a similar crash in pam_securid.so with no mention of MariaDB, it seems likely to me that this could be caused by some bug in pam_securid.so. I asked the user if they have some support channel at RSA that they can use to ask them for help. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2016-07-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
RSA was not very helpful:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-07-26 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've pushed a commit that adds debug output to pam plugin into bb-10.1-serg branch. When it'll build, you can find binaries at the usual location. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-09-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It turned out to be an issue in SQLyog, not Connector/C or MariaDB. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2017-11-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The user who reported this issue says that SQLyog still causes MariaDB to crash, and that the problem goes away if SQLyog is built with MySQL's connector instead of MariaDB Connector/C. This appears to be a bug in MariaDB and/or MariaDB Connector/C. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2018-03-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm closing this, because this problem probably reflects a bug in pam_securid.so which would have to be fixed by RSA rather than MariaDB. |