CVE-2023-6395
Python vulnerability analysis and mitigation

Overview

CVE-2023-6395 is a security vulnerability discovered in the Mock software, a chroot build environment manager for building RPM packages. The vulnerability was disclosed on January 16, 2024, affecting the Mock software's templated-dictionary component. The issue stems from the absence of proper sandboxing during the expansion and execution of Jinja2 templates, which can be included in certain configuration parameters (NVD, OSS-Security).

Technical details

The vulnerability exists in the Mock software's handling of Jinja2 templates through the TemplatedDictionary python class. The issue was introduced in mock 1.4 in 2019 and later split into a separate project in 2021. The vulnerability has received a CVSS v3.1 base score of 6.7 (Medium) from Red Hat with vector AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H, while NVD assigned a score of 9.8 (Critical) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

If exploited, this vulnerability allows attackers to achieve privilege escalation and execute arbitrary code with root user privileges on the build server. While 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 that could be exploited (OSS-Security).

Mitigation and workarounds

The issue has been fixed in templated-dictionary version 1.4.1 through two main patches: implementing a sandboxed jinja2 environment and making the TemplatedDictionary objects picklable. Updates have been released for various distributions including Fedora 38 and 39. Users are advised to upgrade to the patched versions (GitHub Patch, Fedora Update).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-21441HIGH8.9
  • PythonPython
  • urllib3
NoYesJan 07, 2026
CVE-2026-21851MEDIUM5.3
  • PythonPython
  • monai
NoNoJan 07, 2026
GHSA-f2mf-q878-gh58MEDIUM5.3
  • PythonPython
  • parsl
NoYesJan 06, 2026
CVE-2026-21883MEDIUM4.5
  • PythonPython
  • bokeh
NoYesJan 08, 2026
CVE-2026-22041LOW2
  • PythonPython
  • loggingredactor
NoYesJan 07, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management