Cloudanix VulnDB

CVE-2016-4984

Medium · 4.7

CVSS

4.7

EPSS

0.1%

Published

Jul 17, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A setup script on some directory servers can briefly leave its encryption certificate readable by other users on the same machine, allowing those users to copy it.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
High
Impact
Data Exposure
Component
Application
Class
Race Condition
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Race condition in generate-server-cert.sh allows a local process to read the newly created TLS certificate file before chmod restricts its permissions.

Why it matters to the business

Attackers with local access on affected systems may obtain encryption material intended to protect LDAP traffic, increasing risk of credential or session interception on servers that rely on auto-generated certificates.

How an attack unfolds

An attacker with a local account monitors the file system for the temporary certificate file created by the script, opens a read handle during the window before chmod executes, and copies the certificate contents for later use in decrypting traffic or impersonating the server.

How to fix it

Replace or patch the generate-server-cert.sh script to create the certificate with restrictive permissions (0600) from the start, or manually enforce correct ownership and mode on any generated certificate and key files; upgrade to a version of openldap-servers that eliminates the race condition when available.

How to confirm the fix worked

After remediation, re-run the certificate generation process under load and verify that the resulting certificate file has mode 0600 and is owned by the appropriate service account before any other user can access it.

Typical attack path

  1. Obtain local shell access on a system running openldap-servers
  2. Trigger or wait for the generate-server-cert.sh script to execute (typically during package installation or configuration)
  3. Exploit the race window to open and read the certificate file before permissions are tightened
  4. Retain the certificate for offline use against LDAP TLS sessions

How to detect it

Search system logs and file-system audit trails around package installation or slapd startup times for unexpected reads of certificate files created by generate-server-cert.sh; examine process listings and file-access events for non-root processes accessing the certificate during its creation window.

What your security team should do

  • Audit all systems running openldap-servers for the presence of the vulnerable generate-server-cert.sh script
  • Apply vendor updates or manual permission hardening immediately on any host that still uses the script
  • Scan for world-readable certificate or key files under /etc/openldap or similar paths
  • Review LDAP server configurations to confirm they do not rely on auto-generated certificates created by the flawed script

The record

/usr/libexec/openldap/generate-server-cert.sh in openldap-servers sets weak permissions for the TLS certificate, which allows local users to obtain the TLS certificate by leveraging a race condition between the creation of the certificate, and the chmod to protect it.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities