# CVE-2017-3291: Oracle MySQL and MariaDB privilege escalation in mysqld_safe ledir option

Source: https://junglewise.ai/threats/cve-2017-3291-oracle-mysql-and-mariadb-privilege-escalation-in-mysqld-safe-ledir  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-01-27. Updated: 2026-05-13  
License: CC BY 4.0 with a link back

CVE-2017-3291 · Severity: medium · CVSS 6.3 · Published 2017-01-27

A security vulnerability in the MySQL and MariaDB database management systems could allow a highly privileged local user to take full control of the database server. This issue stems from how the system handles configuration files during startup and maintenance. An exploit requires the attacker to already have significant access to the underlying server infrastructure and involves some level of interaction from another user, making it difficult to execute in practice.

Technologies: [Oracle MySQL Server](https://junglewise.ai/threats/technologies/mysql-server). Vendors: [Oracle](https://junglewise.ai/threats/vendors/oracle).

## Quick answers

**Is CVE-2017-3291 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2017-3291 being exploited in the wild.

**How severe is CVE-2017-3291?** Medium severity, with a CVSS score of 6.3, published 27 January 2017.

**Which products and versions are affected?** Oracle MySQL Server 5.5.53 and earlier, 5.6.34 and earlier, 5.7.16 and earlier.

**Is there a fix for CVE-2017-3291?** A patch was published on 2017-01-19: Debian released fix for mysql-5.5 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2017-3291 attacked?** It is attacked with local access, in an operating system.

**Am I affected by CVE-2017-3291?** Check whether you run Oracle MySQL Server at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A privilege escalation vulnerability exists in the 'mysqld_safe' script within the Server: Packaging subcomponent of Oracle MySQL and MariaDB. The root cause is the script's improper handling of the 'ledir' option when specified in a MySQL configuration file. A local attacker with high privileges (such as the 'mysql' operating system user) who can modify configuration files can exploit this to execute arbitrary code or escalate privileges to root. Exploitation is considered difficult as it requires local infrastructure access, high privileges, and human interaction from a person other than the attacker. The issue is resolved in MySQL versions 5.5.54, 5.6.35, 5.7.17 and MariaDB versions 5.5.54, 10.0.29, and 10.1.21.

## Affected products

- Oracle MySQL Server 5.5.53 and earlier, 5.6.34 and earlier, 5.7.16 and earlier
- MariaDB Foundation MariaDB 5.5.0 before 5.5.54, 10.0.0 before 10.0.29, 10.1.0 before 10.1.21

## Timeline

- 2017-01-19: patched: Debian released fix for mysql-5.5
- 2017-01-22: patched: Debian released fix for mariadb-10.0
- 2017-01-27: advisory: NVD publication date

## References

- [http://www.debian.org/security/2017/dsa-3767](http://www.debian.org/security/2017/dsa-3767)
- [http://www.debian.org/security/2017/dsa-3770](http://www.debian.org/security/2017/dsa-3770)
- [http://www.oracle.com/technetwork/security-advisory/cpujan2017-2881727.html](http://www.oracle.com/technetwork/security-advisory/cpujan2017-2881727.html)
- [http://www.securityfocus.com/bid/95501](http://www.securityfocus.com/bid/95501)
- [http://www.securitytracker.com/id/1037640](http://www.securitytracker.com/id/1037640)
- [https://access.redhat.com/errata/RHSA-2017:2192](https://access.redhat.com/errata/RHSA-2017:2192)
- [https://access.redhat.com/errata/RHSA-2017:2787](https://access.redhat.com/errata/RHSA-2017:2787)

## Related threats

- [Oracle MySQL Server XML parsing privilege escalation](https://junglewise.ai/threats/cve-2026-101803-vulnerability-in-the-mysql-server-mysql-cluster-product-of)
- [Oracle MySQL Server parser denial of service](https://junglewise.ai/threats/cve-2026-101802-vulnerability-in-the-mysql-server-mysql-cluster-product-of)
- [Oracle MySQL Server Optimizer denial of service](https://junglewise.ai/threats/cve-2026-101801-vulnerability-in-the-mysql-server-mysql-cluster-product-of)
- [Oracle MySQL Server privilege escalation in Security: Privileges](https://junglewise.ai/threats/cve-2026-101800-vulnerability-in-the-mysql-server-mysql-cluster-product-of)
- [Oracle MySQL Server denial of service in Group Replication](https://junglewise.ai/threats/cve-2026-101799-vulnerability-in-the-mysql-server-mysql-cluster-product-of)
