CVEfocus › CVE database › CVE-2023-6395

CVE-2023-6395Mock: privilege escalation for users that can access mock configuration

CVSS 6.7 MediumEPSS 1.6% (higher than 77% of CVEs)Published 2024-01-16Updated 2025-02-13Assigner: redhat

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.

CWE-20CWE-94

What to do

Fixed builds are available from PyPI: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
3Fix pending
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 18.04mockFix pendingUBUNTU-CVE-2023-6395
Ubuntu 16.04mockFix pendingUBUNTU-CVE-2023-6395
Ubuntu 14.04mockFix pending
Red Hat Enterprise Linux 6mockNot affected
PyPI librarytemplated-dictionaryFixed1.4.1GHSA-7j98-74jh-cjxh

What the vendor says

As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

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.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.