// For flags

CVE-2023-6395

Mock: privilege escalation for users that can access mock configuration

Severity Score

9.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Attend
*SSVC
Descriptions

The Mock software contains a vulnerability wherein an attacker could potentially exploit privilege escalation, enabling the execution of arbitrary code with root user privileges. This weakness stems from the absence of proper sandboxing during the expansion and execution of Jinja2 templates, which may be included in certain configuration parameters. While the Mock documentation advises treating users added to the mock group as privileged, certain build systems invoking mock on behalf of users might inadvertently permit less privileged users to define configuration tags. These tags could then be passed as parameters to mock during execution, potentially leading to the utilization of Jinja2 templates for remote privilege escalation and the execution of arbitrary code as the root user on the build server.

El software Mock contiene una vulnerabilidad en la que un atacante podría explotar la escalada de privilegios, permitiendo la ejecución de código arbitrario con privilegios de usuario root. Esta debilidad se debe a la ausencia de una sandbox adecuada durante la expansión y ejecución de las plantillas de Jinja2, que pueden incluirse en ciertos parámetros de configuración. Si bien la documentación de Mock recomienda tratar a los usuarios agregados al grupo simulado como privilegiados, ciertos sistemas de compilación que invocan simulacros en nombre de los usuarios podrían permitir sin darse cuenta que usuarios con menos privilegios definan etiquetas de configuración. Luego, estas etiquetas podrían pasarse como parámetros para simular durante la ejecución, lo que podría llevar a la utilización de plantillas Jinja2 para la escalada remota de privilegios y la ejecución de código arbitrario como usuario raíz en el servidor de compilación.

*Credits: Red Hat would like to thank Sankin Nikita Alexeevich for reporting this issue.
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Local
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
* Common Vulnerability Scoring System
SSVC
  • Decision:Attend
Exploitation
None
Automatable
Yes
Tech. Impact
Total
* Organization's Worst-case Scenario
Timeline
  • 2023-11-30 CVE Reserved
  • 2024-01-16 CVE Published
  • 2024-10-25 CVE Updated
  • 2024-10-25 First Exploit
  • 2024-10-26 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-20: Improper Input Validation
  • CWE-94: Improper Control of Generation of Code ('Code Injection')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Rpm-software-management
Search vendor "Rpm-software-management"
Mock
Search vendor "Rpm-software-management" for product "Mock"
--
Affected
Fedoraproject
Search vendor "Fedoraproject"
Extra Packages For Enterprise Linux
Search vendor "Fedoraproject" for product "Extra Packages For Enterprise Linux"
7.0
Search vendor "Fedoraproject" for product "Extra Packages For Enterprise Linux" and version "7.0"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Extra Packages For Enterprise Linux
Search vendor "Fedoraproject" for product "Extra Packages For Enterprise Linux"
8.0
Search vendor "Fedoraproject" for product "Extra Packages For Enterprise Linux" and version "8.0"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Extra Packages For Enterprise Linux
Search vendor "Fedoraproject" for product "Extra Packages For Enterprise Linux"
9.0
Search vendor "Fedoraproject" for product "Extra Packages For Enterprise Linux" and version "9.0"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
38
Search vendor "Fedoraproject" for product "Fedora" and version "38"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
39
Search vendor "Fedoraproject" for product "Fedora" and version "39"
-
Affected