CVE-2020-25584

7.5 HIGH

📋 TL;DR

This vulnerability allows a superuser inside a FreeBSD jail with the non-default allow.mount permission to exploit a race condition between directory lookup and filesystem remounting, enabling access to filesystem hierarchy outside the jail. It affects FreeBSD systems running specific STABLE, RELEASE, and RC versions where jails with mount permissions are configured.

💻 Affected Systems

Products:
  • FreeBSD
Versions: FreeBSD 13.0-STABLE before n245118, 12.2-STABLE before r369552, 11.4-STABLE before r369560, 13.0-RC5 before p1, 12.2-RELEASE before p6, and 11.4-RELEASE before p9
Operating Systems: FreeBSD
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when jails are configured with the non-default allow.mount permission. Standard jail configurations without mount permissions are not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

A malicious superuser inside a jail could escape confinement and access, modify, or delete sensitive files on the host system, potentially compromising the entire server.

🟠

Likely Case

Privileged users within jails could access restricted files outside their jail boundaries, violating security isolation and potentially exposing sensitive data.

🟢

If Mitigated

With proper jail configuration (no allow.mount permission), the vulnerability cannot be exploited, maintaining full jail isolation.

🌐 Internet-Facing: LOW - Exploitation requires superuser access within a jail, which typically isn't exposed directly to the internet.
🏢 Internal Only: MEDIUM - Internal privileged users with jail access and mount permissions could exploit this to breach jail isolation.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires superuser privileges within a jail and the allow.mount permission, plus precise timing for the race condition.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: FreeBSD 13.0-STABLE n245118+, 12.2-STABLE r369552+, 11.4-STABLE r369560+, 13.0-RC5 p1+, 12.2-RELEASE p6+, 11.4-RELEASE p9+

Vendor Advisory: https://security.FreeBSD.org/advisories/FreeBSD-SA-21:10.jail_mount.asc

Restart Required: Yes

Instructions:

1. Update FreeBSD using 'freebsd-update fetch' and 'freebsd-update install' for RELEASE versions. 2. For STABLE versions, update source and rebuild kernel. 3. Reboot the system to load the patched kernel.

🔧 Temporary Workarounds

Remove jail mount permissions

all

Disable the allow.mount permission for all jails to prevent exploitation.

jail -m name=JAILNAME allow.mount=0

Restrict jail superuser access

all

Limit superuser privileges within jails to trusted users only.

🧯 If You Can't Patch

  • Remove allow.mount permission from all jail configurations immediately.
  • Audit and restrict superuser access within jails to minimize attack surface.

🔍 How to Verify

Check if Vulnerable:

Check FreeBSD version with 'uname -a' and compare against affected versions. Verify jail configurations for allow.mount=1 settings.

Check Version:

uname -a

Verify Fix Applied:

Confirm version is patched with 'uname -a' showing updated version. Verify kernel build date or revision matches patched versions.

📡 Detection & Monitoring

Log Indicators:

  • Unusual mount operations within jails
  • Failed jail boundary access attempts in system logs

SIEM Query:

Search for 'jail' AND 'mount' events in system logs, particularly from privileged users within jail contexts.

🔗 References

📤 Share & Export