CVE-2023-6395
JSON

6.7medium

Mock: privilege escalation for users that can access mock configuration

Severity
6.7medium CVSS:3.1 by redhat
Exploit likelihood
1.55% (higher than 75% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
redhat
Also known as
GHSA-7j98-74jh-cjxhPYSEC-2026-1949

Description

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.

Affected

Product or packageVersionsReported by
mockNot specifiedCVE List
templated-dictionary (PyPI)before 1.4.1GitHub Advisory Database, PyPA Advisory Database
rpm-software-management mockNot specifiedNVD
fedoraproject extra_packages_for_enterprise_linux7.0, 8.0, 9.0NVD
fedoraproject fedora38, 39NVD

All scores

redhat6.7medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
GitHub6.7medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory Database6.7medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-20CWE-94

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

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.

NVD (es)

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.

References

https://access.redhat.com/security/cve/CVE-2023-6395third-party-advisory, vdb-entry, web
https://bugzilla.redhat.com/show_bug.cgi?id=2252206issue-tracking, third-party-advisory, web
https://github.com/xsuchy/templated-dictionary/commit/0740bd0ca8d487301881541028977d120f8b8933patch, web
https://github.com/xsuchy/templated-dictionary/commit/bcd90f0dafa365575c4b101e6f5d98c4ef4e4b69patch, web
http://www.openwall.com/lists/oss-security/2024/01/16/1mailing-list, patch, third-party-advisory, web
http://www.openwall.com/lists/oss-security/2024/01/16/3exploit, mailing-list, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NBFYREAJH4T7GXXQZ4GJEREN4Q3AHS3K/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/62SP2BJC2AFLFJJAEHPGZ3ZINTBTI7AN/
https://nvd.nist.gov/vuln/detail/CVE-2023-6395advisory
https://github.com/xsuchy/templated-dictionarypackage
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/62SP2BJC2AFLFJJAEHPGZ3ZINTBTI7ANweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NBFYREAJH4T7GXXQZ4GJEREN4Q3AHS3Kweb

Sources

SourceRecordLicence
CVE ListCVE-2023-6395 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-7j98-74jh-cjxh changed 2026-07-07CC-BY-4.0
NVDCVE-2023-6395 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1949 changed 2026-07-07CC-BY-4.0