CVE-2023-6395

Public Exploit
Mock: privilege escalation for users that can access mock configuration

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.

Remediation

Workaround:

  • Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

Categories

6.7
CVSS
Severity: Medium
CVSS 3.1 •
EPSS 0.35%
Third-Party Advisory openwall.com Third-Party Advisory openwall.com Third-Party Advisory redhat.com Third-Party Advisory redhat.com
Affected: n/a mock
Affected: Red Hat Red Hat Enterprise Linux 6
Affected: Fedora Extra Packages for Enterprise Linux
Affected: Fedora Fedora
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-6395?
CVE-2023-6395 has been scored as a medium severity vulnerability.
How to fix CVE-2023-6395?
As a workaround for remediating CVE-2023-6395: Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
Is CVE-2023-6395 being actively exploited in the wild?
It is possible that CVE-2023-6395 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-6395?
CVE-2023-6395 affects n/a mock, Red Hat Red Hat Enterprise Linux 6, Fedora Extra Packages for Enterprise Linux, Fedora Fedora.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.