The second vulnerability identified was in the Miniconda3 package installer before v23.11.0–1. Again, it was possible to inject scripts created by the installer and subsequently executed with root permissions to achieve local privilege escalation:
Press enter or click to view image in full size
Command Injection
Using our modified file monitor, two post-link files, packaged as part of miniconda3/pkgs/python.app-3-py310h1a28f6b_0.conda and unpackaged during installation by prepare_installation.pkg, were susceptible to injection:
The following screenshot shows the expanded package installer where the prepare_installation.pkg resides:
Miniconda3-py310_23.10.0-1-MacOSX-arm64.pkgPrivileged Execution
The two injected post-link files were written to disk and executed during installation with elevated permissions by conda.exe – located in the installer’s run_installation.pkg/Scripts/postinstall script:
# Perform the conda install
...
PREFIX="$2/miniconda3"
PREFIX=$(cd "$PREFIX"; pwd)
export PREFIX
echo "PREFIX=$PREFIX"
CONDA_EXEC="$PREFIX/conda.exe"
# /COMMON UTILS
...
"$CONDA_EXEC" install --offline --file "$PREFIX/pkgs/env.txt" -yp "$PREFIX"…