CVE-2023-6395
published medium CVSS 3.1 · 6.7Mock: privilege escalation for users that can access mock configuration
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| n/a | — | mock | Affected | Not stated | redhat |
| Red Hat Enterprise Linux | 6 | mock | Unaffected | Not required | redhat |
| Fedora | — | mockExtra Packages for Enterprise Linux | Affected | Not stated | redhat |
| Fedora | — | mockFedora | Affected | Not stated | redhat |
| Amazon Linux | AL2 | Release evaluationALAS2MOCK-2025-001 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | Release evaluationALAS2MOCK2-2025-001 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2 | mocknoarch | Listed in advisory | Not stated | ALAS2MOCK-2025-001 |
| Amazon Linux | AL2 | mocksrc | Listed in advisory | Not stated | ALAS2MOCK-2025-001 |
Show 2 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Amazon Linux | AL2 | python-templated-dictionarynoarch | Listed in advisory | Not stated | ALAS2MOCK2-2025-001 |
| Amazon Linux | AL2 | python-templated-dictionarysrc | Listed in advisory | Not stated | ALAS2MOCK2-2025-001 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 6.7 / 10
- Severity
- medium
- Provider
- redhat · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| n/a | mock | Default: affected | redhat · cna |
| Red Hat | Red Hat Enterprise Linux 6 | Default: unaffected | redhat · cna |
| Fedora | Extra Packages for Enterprise Linux | Default: affected | redhat · cna |
| Fedora | Fedora | Default: affected | redhat · cna |
Weaknesses
2- CWE-20 Improper Input Validation
- CWE-94 CWE-94 Improper Control of Generation of Code ('Code Injection')
References
8- http://www.openwall.com/lists/oss-security/2024/01/16/1
- http://www.openwall.com/lists/oss-security/2024/01/16/3
- https://access.redhat.com/security/cve/CVE-2023-6395
- RHBZ#2252206 https://bugzilla.redhat.com/show_bug.cgi?id=2252206
- https://github.com/xsuchy/templated-dictionary/commit/0740bd0ca8d487301881541028977d120f8b8933
- https://github.com/xsuchy/templated-dictionary/commit/bcd90f0dafa365575c4b101e6f5d98c4ef4e4b69
- https://lists.fedoraproject.org/archives/list/[email protected]/message/62SP2BJC2AFLFJJAEHPGZ3ZINTBTI7AN/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/NBFYREAJH4T7GXXQZ4GJEREN4Q3AHS3K/
Provider assertions
3redhat · cna
Mock: privilege escalation for users that can access mock configuration
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 48ed1a3d04fdc0d9e23b9bc32aeb91cc56bba7dd4c95f38ddf16722754fab294
- Ingested
- 23 Sep 2026, 08:15:42 UTC
- Source record
- Official CVE record