Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2023-25657

HIGH 7.5EPSS 81%

Remote code execution in Jinja2 template rendering in Nautobot

Also known as GHSA-8mfq-f5wj-vw5m, PYSEC-2023-37

Mitigation

  • Upgrade nautobot to 1.5.7 or later.

Who should check

  • Projects that depend on PyPI package nautobot (< 1.5.7)
  • Anyone running nautobot < 1.5.7

Vulnerability facts

Affected
nautobot < 1.5.7
Fixed in
1.5.7
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, login needed
CVSS
7.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: High
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
1.93% chance of exploitation in 30 days (percentile 81, 2026-11-26)
CWE
CWE-94
Published
Modified

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 has enabled sandboxed environments for the Jinja2 template engine used internally for template rendering for the following objects: `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 suggesting the direct use of `jinja2.Template` has been revised to suggest `render_jinja2`. Users are advised to upgrade to Nautobot 1.5.7 or newer. 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. **Note:** *Nautobot specifies two template engines by default, the first being “django” for the Django built-in template engine, and the second being “jinja” for the Jinja2 template engine. This recommended setting will update the second item in the list of template engines, which is the Jinja2 engine.* For users that are unable to immediately update their configuration such as if a Nautobot service restart is too disruptive to operations, access to provide custom Jinja2 template values may be mitigated using permissions to restrict “change” (write) actions to the affected object types listed in the first section. **Note:** *This solution is intended to be stopgap until you can successfully update your `nautobot_config.py` or upgrade your Nautobot instance to apply the sandboxed environment enforcement.*

Affected and fixed versions

Package / productAffectedFixedSource
PyPI nautobot< 1.5.71.5.7osv
nautobot< 1.5.7—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

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

Details: https://flawdb.com/CVE-2023-25657.md
Affected: nautobot < 1.5.7
Fixed in: 1.5.7

Steps:
1. Search this machine and project for nautobot (PyPI), nautobot: 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.

References

FAQ

Is CVE-2023-25657 being exploited?

There is no confirmed exploitation: CVE-2023-25657 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.93% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2023-25657?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, login needed. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2023-25657?

nautobot < 1.5.7.

Is there a fix for CVE-2023-25657?

Yes. Fixed in 1.5.7. Upgrade nautobot to 1.5.7 or later.

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

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.

Sponsors