From User to Root: Exploiting a Privilege Escalation Bug in Azure Storage Utility
A critical privilege escalation vulnerability has been discovered in AZNFS-mount, a utility preinstalled on Azure HPC/AI Linux images. The flaw, which affects all versions up to 2.0.10, allows unprivileged users to escalate privileges to root, posing a serious threat to environments that rely on NFS access to Azure Blob storage.
What Is AZNFS-Mount and Why It Matters
AZNFS-mount enables mounting of Azure Storage Account NFS endpoints, simplifying data access even when IP addresses change. Installed via aznfs_install.sh
, the tool includes binaries that require superuser permissions to manage mount points and DNAT rules. This utility is widely used in high-performance computing (HPC) and AI workloads in Azure.
The Vulnerability: SUID Misuse and Environment Variable Exploitation
At the core of the issue is the mount.aznfs
binary, installed with the SUID bit (file mode 4755), allowing any user to execute it with root privileges. It leverages the execv
function to run a Bash script (/opt/microsoft/aznfs/mountscript.sh
) while preserving environment variables.
According to a detailed Varonis report, an attacker can manipulate the BASH_ENV
environment variable to inject arbitrary commands. When BASH_ENV
is set to something like $(malicious_command)
, Bash attempts to evaluate and execute the command during script execution — effectively granting root-level access.
Potential Impact
Successful exploitation could allow attackers to:
-
Mount unauthorized storage containers
-
Install backdoors or malware
-
Move laterally within cloud-hosted environments
Although Microsoft has classified the issue as low severity, the potential for damage in sensitive environments makes it a significant risk.
Who Is Affected and How to Mitigate
This vulnerability affects all AZNFS-mount versions up to 2.0.10. It is especially concerning for users of Azure HPC images or any deployments using NFS for Azure Storage.
A fix has been released in version 2.0.11, and Microsoft has updated the Kubernetes blob-csi-driver accordingly. Organizations are strongly advised to:
-
Enable auto-updates for AZNFS-mount
-
Or manually update to the latest patched version
-
Review access configurations on NFS-mounted Azure Blob storage
Why NFS Access in Azure Is Uniquely Risky
Unlike other Azure Storage access methods (REST API, SFTP), NFS endpoints do not support Azure’s role-based access control (RBAC) or attribute-based policies. If an attacker gains NFS access, they can access all objects in the container, regardless of storage-level permissions.
While Microsoft downplays the severity, the presence of a root-exploitable SUID binary in a default utility demands urgent attention. As with all cloud environments, regular reviews of access controls and security configurations remain critical to maintaining a strong security posture.
Comments
Post a Comment