CVE-2021-31215
Description
In Slurm before 20.02.7 and 20.11.7, mishandling of environment variables in PrologSlurmctld or EpilogSlurmctld scripts allows remote code execution as SlurmUser.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In Slurm before 20.02.7 and 20.11.7, mishandling of environment variables in PrologSlurmctld or EpilogSlurmctld scripts allows remote code execution as SlurmUser.
Vulnerability
SchedMD Slurm versions before 20.02.7 and 20.03.x through 20.11.x before 20.11.7 are vulnerable to remote code execution due to environment mishandling when using a PrologSlurmctld or EpilogSlurmctld script [2]. The issue allows an attacker to manipulate environment variables to execute arbitrary commands as the SlurmUser.
Exploitation
An attacker must have the ability to submit a job that triggers the execution of a PrologSlurmctld or EpilogSlurmctld script. By crafting specific environment variables, the attacker can cause the script to run arbitrary commands. No authentication is specified; any user with job submission rights can exploit this.
Impact
Successful exploitation allows remote code execution as the SlurmUser account, which typically has elevated privileges on the Slurm cluster. This can lead to full compromise of the Slurm controller and potentially other nodes.
Mitigation
The vulnerability is fixed in Slurm versions 20.02.7 and 20.11.7, released on May 12, 2021 [2]. Users should upgrade to these versions or later. As a workaround, ensure that PrologSlurmctld and EpilogSlurmctld scripts are not used or are properly secured.
AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
22- SchedMD/Slurmdescription
- osv-coords20 versionspkg:rpm/opensuse/slurm&distro=openSUSE%20Leap%2015.2pkg:rpm/opensuse/slurm&distro=openSUSE%20Tumbleweedpkg:rpm/suse/slurm_18_08&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/slurm_18_08&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/slurm_18_08&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2012pkg:rpm/suse/slurm_20_02&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/slurm_20_02&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/slurm_20_02&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2012pkg:rpm/suse/slurm_20_11&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/slurm_20_11&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/slurm_20_11&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2pkg:rpm/suse/slurm_20_11&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2012pkg:rpm/suse/slurm_20_11&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2015%20SP2pkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2012pkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2015%20SP2pkg:rpm/suse/slurm&distro=SUSE%20Linux%20Enterprise%20Module%20for%20HPC%2015%20SP3
< 20.02.7-lp152.2.6.1+ 19 more
- (no CPE)range: < 20.02.7-lp152.2.6.1
- (no CPE)range: < 21.08.1-1.1
- (no CPE)range: < 18.08.9-1.14.1
- (no CPE)range: < 18.08.9-1.14.1
- (no CPE)range: < 18.08.9-3.14.1
- (no CPE)range: < 20.02.7-3.19.1
- (no CPE)range: < 20.02.7-3.19.1
- (no CPE)range: < 20.02.7-3.11.1
- (no CPE)range: < 20.11.7-3.11.1
- (no CPE)range: < 20.11.7-3.11.1
- (no CPE)range: < 20.11.7-6.5.1
- (no CPE)range: < 20.11.7-3.8.1
- (no CPE)range: < 20.11.7-6.5.1
- (no CPE)range: < 18.08.9-3.19.1
- (no CPE)range: < 18.08.9-3.19.1
- (no CPE)range: < 17.11.13-6.37.1
- (no CPE)range: < 17.11.13-6.37.1
- (no CPE)range: < 17.02.11-6.50.1
- (no CPE)range: < 20.02.7-3.6.1
- (no CPE)range: < 20.11.7-4.3.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"Environment mishandling when PrologSlurmctld or EpilogSlurmctld scripts are used allows an attacker to influence environment variables and achieve remote code execution as SlurmUser."
Attack vector
An attacker who can submit a job to a Slurm cluster can exploit environment mishandling when a PrologSlurmctld or EpilogSlurmctld script is executed [ref_id=1]. By crafting job submission parameters that influence the environment variables passed to these scripts, the attacker can achieve remote code execution as the SlurmUser. The attack requires the cluster to have PrologSlurmctld or EpilogSlurmctld scripts configured.
Affected code
The vulnerability affects SchedMD Slurm versions before 20.02.7 and 20.03.x through 20.11.x before 20.11.7. The advisory states that the issue arises because "use of a PrologSlurmctld or EpilogSlurmctld script leads to environment mishandling."
What the fix does
The advisory does not include a specific patch diff, but the fix is included in Slurm versions 20.02.7 and 20.11.7 [ref_id=1]. The remediation addresses the environment mishandling that occurs when PrologSlurmctld or EpilogSlurmctld scripts are used, preventing untrusted environment variables from being passed to these scripts and thereby closing the remote code execution vector.
Preconditions
- configThe cluster must have PrologSlurmctld or EpilogSlurmctld scripts configured in slurm.conf
- authThe attacker must be able to submit jobs to the Slurm cluster
Generated on May 29, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3ODMJQNY4FAV7G3DSKVIO5KY7Q7DKBPU/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PRHTASFAU5FNB2MJOG67YID2ONQS5MCQ/mitrevendor-advisoryx_refsource_FEDORA
- lists.debian.org/debian-lts-announce/2022/01/msg00011.htmlmitremailing-listx_refsource_MLIST
- lists.schedmd.com/pipermail/slurm-announce/2021/000055.htmlmitrex_refsource_CONFIRM
- www.schedmd.com/news.phpmitrex_refsource_CONFIRM
News mentions
0No linked articles in our index yet.