[MDEV-32654] CVE-2017-3291 Created: 2023-11-01 Updated: 2023-11-02 Resolved: 2023-11-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Michal Schorm | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | Security | ||
| Environment: |
Fedora / RHEL / CentOS Stream / upstream RPMs |
||
| Description |
|
Hello, It explains, that the `--ledir` option of mysqld_safe MUST NOT be accepted from config file, as an attacker with permission to edit at least some config files can re-define it to run malicious custom version of the server from a custom location. This was fixed in MySQL upstream in this commit: And it is present in the MySQL code base to this day: The MariaDB upstream claims, it fixed the CVE in: The commit that implemented the fix in MariaDB 10.1.21 is this: The fix is present in MariaDB 10.1 series to this day: But it never made it into MariaDB 10.2 and later: So it seems like a security regression in the upstream code of MariaDB. The mysqld_safe is meant to be used on distros without Systemd:
As per: https://mariadb.com/kb/en/mysqld_safe/ Neither Fedora, CentOS Stream, RHEL: That IMO greatly reduces the area of attack, as the server admin had to configure custom systemd service file that would be used for starting the DB, so it would use the mysqld_safe. I'm not sure how to regression came to be. However since we (upstream, Fedora, CentOS Stream, RHEL) all still ship the mysqld_safe (or mariadb-safe), I'd like to clarify, whether it is an overlooked regression, or whether the base ground for this CVE does not exists to begin with in MariaDB 10.2 and later. |
| Comments |
| Comment by Sergei Golubchik [ 2023-11-02 ] | ||||||||||||
|
The fix in MariaDB commit 8fcdd6b0ec rejects --ledir if it comes from my.cnf in the datadir (indeed, because the server has write access to the datadir, so it can modify its own settings there). This fix disappeared in the commit Merge branch '10.1' into 10.2. Part of the merge's diff is
that is, since 10.2 the server no longer reads my.cnf from the datadir at all. Thus a special protection check for that particular case is no longer needed. |