CVE-2025-49142 Overview
CVE-2025-49142 affects Nautobot, a Network Source of Truth and Network Automation Platform developed by Network to Code. The vulnerability stems from insufficient security configuration of the Jinja2 templating feature used in computed fields, custom links, and similar customization points. A malicious authenticated user can craft template expressions that expose the values of Secrets defined in Nautobot. The same template surface can invoke Python APIs to modify data, bypassing object permissions assigned to the viewing user. The flaw is tracked under [CWE-1336] (Improper Neutralization of Special Elements Used in a Template Engine).
Critical Impact
Authenticated users with template configuration access can exfiltrate stored Secrets and perform unauthorized data modifications by abusing the Jinja2 rendering context.
Affected Products
- Nautobot versions prior to 1.6.32
- Nautobot versions prior to 2.4.10
- Network to Code Nautobot deployments using computed fields, custom links, or other Jinja2-templated configuration
Discovery Timeline
- 2025-06-10 - CVE-2025-49142 published to NVD with GitHub Security Advisory GHSA-wjw6-95h5-4jpx
- 2025-08-21 - Last updated in NVD database
Technical Details for CVE-2025-49142
Vulnerability Analysis
Nautobot exposes Jinja2 templating in several user-configurable surfaces, including computed fields, custom links, webhook templates, and export templates. These templates render server-side when an object is viewed or processed. The rendering environment was not constrained by Jinja2's sandbox restrictions and did not enforce Django's alters_data protections on Python callables. As a result, template expressions could traverse object attributes to reach Secret objects and call their resolution methods, returning plaintext secret values to the viewing user. Template expressions could also invoke model methods that mutate the database, bypassing the role-based object permissions enforced at the view layer.
Root Cause
The root cause is the absence of a constrained execution environment around the Jinja2 templating subsystem. Without the Jinja2 sandbox documented at Jinja Sandbox Documentation and without honoring Django's alters_data attribute documented at Django Template API Reference, template authors can reach arbitrary Python attributes and call methods that read or modify protected data.
Attack Vector
The attack requires network access to the Nautobot UI or API and an authenticated account with permission to create or modify Jinja2-templated content. The attacker injects a template expression that walks the Django ORM to read Secret records or to call data-modifying methods. When any user, including a higher-privileged viewer, renders the affected object, the template executes in their session context. The attacker recovers the rendered output or observes the resulting data change. The vulnerability is partially mitigated when object permissions restrict template configuration to trusted users only.
Verified proof-of-concept code is not publicly available. Refer to GitHub PR #7417 and GitHub PR #7429 for the fix implementation.
Detection Methods for CVE-2025-49142
Indicators of Compromise
- Unexpected modifications to computed fields, custom links, export templates, or webhook templates by non-administrative accounts.
- Audit log entries showing template renders followed by reads of Secret model records outside of normal automation workflows.
- Outbound traffic from the Nautobot host containing strings that match known secret formats stored in the platform.
Detection Strategies
- Review the Nautobot change log for recent edits to objects that support Jinja2 templating, focusing on expressions that reference secrets, Secret, _meta, or __class__.
- Compare installed Nautobot versions against 1.6.32 and 2.4.10 across all environments using package inventory data.
- Correlate template-render events with subsequent API calls that read or modify sensitive models.
Monitoring Recommendations
- Enable verbose Django logging for the Nautobot application and forward logs to a central analytics platform for retention and search.
- Alert on creation or modification of computed fields and custom links by accounts outside an approved administrator group.
- Monitor secret-access events and compare them against expected automation patterns to surface anomalous reads.
How to Mitigate CVE-2025-49142
Immediate Actions Required
- Upgrade Nautobot to version 1.6.32 or 2.4.10 or later as documented in GitHub Security Advisory GHSA-wjw6-95h5-4jpx.
- Audit existing computed fields, custom links, export templates, and webhook templates for unexpected Jinja2 expressions before and after upgrade.
- Restrict object permissions so that only trusted administrators can create or modify Jinja2-templated content.
Patch Information
Network to Code released fixes in Nautobot 1.6.32 and 2.4.10. The patches introduce a sandboxed Jinja2 environment and enforce Django's alters_data protections on callables exposed to templates. Implementation details are available in GitHub PR #7417 and GitHub PR #7429.
Workarounds
- Limit the extras.change_computedfield, extras.change_customlink, and related permissions to a small set of trusted administrators until patching is complete.
- Remove or disable computed fields and custom links that are not strictly required for operations.
- Rotate any Secrets stored in Nautobot after patching if there is any indication that template surfaces may have been abused.
# Upgrade Nautobot using pip in the application virtualenv
pip install --upgrade "nautobot>=2.4.10"
# Or for the 1.6.x branch
pip install --upgrade "nautobot>=1.6.32,<2.0.0"
nautobot-server post_upgrade
systemctl restart nautobot nautobot-worker
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

