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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.7
- **CVSS:** 6.7 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: High; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 1.64% (percentile 77, 2026-11-26)
- **CWE:** CWE-20
- **Aliases:** GHSA-7j98-74jh-cjxh, PYSEC-2026-1949
- **Published:** 2024-01-16T14:33:02.308Z
- **Modified:** 2026-07-07T17:57:36.802Z

## Who should check

- Projects that depend on PyPI package templated-dictionary (\< 1.4.1)
- Anyone running mock all versions
- Anyone running Red Hat Enterprise Linux 6 (versions: see the vendor advisory)
- Anyone running Fedora Extra Packages for Enterprise Linux all versions
- Anyone running Fedora all versions

## 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 and fixed versions

- PyPI `templated-dictionary`: affected \< 1.4.1; fixed 1.4.1 (osv)
- mock: all versions (cvelist)
- Red Hat Enterprise Linux 6: see vendor advisory (cvelist)
- Fedora Extra Packages for Enterprise Linux: all versions (cvelist)
- Fedora: all versions (cvelist)

## Mitigation

- Upgrade templated-dictionary to 1.4.1 or later.
- Vendor 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.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-6395. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-6395.md
Affected: templated-dictionary < 1.4.1
Fixed in: 1.4.1

Steps:
1. Search this machine and project for templated-dictionary (PyPI), mock, Red Hat Enterprise Linux 6, Fedora Extra Packages for Enterprise Linux, Fedora: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-6395 being exploited?

There is no confirmed exploitation: CVE-2023-6395 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 1.64% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-6395?

Medium: CVSS 6.7 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-6395?

templated-dictionary \< 1.4.1.

### Is there a fix for CVE-2023-6395?

Yes. Fixed in 1.4.1. Upgrade templated-dictionary to 1.4.1 or later. Vendor 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.

### How do I check if I'm affected by CVE-2023-6395?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2023-6395>
- vendor: <https://github.com/advisories/GHSA-7j98-74jh-cjxh>
- patch: <https://github.com/xsuchy/templated-dictionary/commit/0740bd0ca8d487301881541028977d120f8b8933>
- patch: <https://github.com/xsuchy/templated-dictionary/commit/bcd90f0dafa365575c4b101e6f5d98c4ef4e4b69>
- patch: <http://www.openwall.com/lists/oss-security/2024/01/16/1>
- exploit: <http://www.openwall.com/lists/oss-security/2024/01/16/3>
- other: <https://access.redhat.com/security/cve/CVE-2023-6395>
- other: <https://bugzilla.redhat.com/show_bug.cgi?id=2252206>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NBFYREAJH4T7GXXQZ4GJEREN4Q3AHS3K/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/62SP2BJC2AFLFJJAEHPGZ3ZINTBTI7AN/>
- other: <https://github.com/xsuchy/templated-dictionary>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/62SP2BJC2AFLFJJAEHPGZ3ZINTBTI7AN>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NBFYREAJH4T7GXXQZ4GJEREN4Q3AHS3K>
- other: <https://pypi.org/project/templated-dictionary>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-6395>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-7j98-74jh-cjxh> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-1949> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2023-6395> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-6395>
