Xiaoc

Pesquisador deTT-Lab
#2704de 53,632
93.1CVSS total
Vulnerabilidades · 12
Média
2
Alta
8
Crítica
2
PT-2023-20217
7.7
2023-02-21
Nautobot · Nautobot · CVE-2023-25657
**Name of the Vulnerable Software and Affected Versions** Nautobot versions prior to 1.5.7 **Description** Nautobot is a Network Source of Truth and Network Automation Platform. All users of Nautobot versions earlier than 1.5.7 are impacted by a remote code execution vulnerability. Nautobot did not properly sandbox Jinja2 template rendering. In Nautobot 1.5.7, sandboxed environments for the Jinja2 template engine used internally for template rendering for the following objects have been enabled: `extras.ComputedField`, `extras.CustomLink`, `extras.ExportTemplate`, `extras.Secret`, `extras.Webhook`. While no active exploits of this vulnerability are known, this change has been made as a preventative measure to protect against any potential remote code execution attacks utilizing maliciously crafted template code. This change forces the Jinja2 template engine to use a `SandboxedEnvironment` on all new installations of Nautobot. This addresses any potential unsafe code execution everywhere the helper function `nautobot.utilities.utils.render jinja2` is called. Additionally, the documentation that had previously suggested the direct use of `jinja2.Template` has been revised to suggest `render jinja2`. **Recommendations** For users that are unable to upgrade to the latest release of Nautobot, you may add the following setting to your `nautobot config.py` to apply the sandbox environment enforcement: `TEMPLATES[1]["OPTIONS"]["environment"] = "jinja2.sandbox.SandboxedEnvironment"`. After applying this change, you must restart all Nautobot services, including any Celery worker processes. For users that are unable to immediately update their configuration, access to provide custom Jinja2 template values may be mitigated using permissions to restrict “change” (write) actions to the affected object types listed. Nautobot App authors or Job authors should replace any custom code using `jinja2.Template` with the `nautobot.utilities.utils.render jinja2` function to ensure the centrally-provided Jinja2 template engine with sandboxing enforced is being utilized. Users are advised to upgrade to Nautobot 1.5.7 or newer.