CVE-2023-48705: Nautobot Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-cf9f-wmhp-v4pr
CVSS 7.1
CWE-79
Published
Advisory Summary

CVE-2023-48705 is a HIGH (CVSS 7.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Nautobot libraries in the PyPI ecosystem. The issue involves cross-site scripting potential in custom links, job buttons, and computed fields. Remediation is available by upgrading affected packages to version 1.6.6, 2.0.5.

CVE-2023-48705 at a Glance

CVE Identifier CVE-2023-48705
GHSA Identifier GHSA-cf9f-wmhp-v4pr
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Nautobot
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2023-48705

To remediate this vulnerability, upgrade all affected Nautobot dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nautobot fixed: 1.6.6
pip install nautobot>=1.6.6
nautobot fixed: 2.0.5
pip install nautobot>=2.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show nautobot

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-48705, inspect your installed packages using pip:

pip show nautobot

Analyze the terminal output to locate any version of Nautobot in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.6), your application is affected.

Note: The pip show nautobot command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Nautobot, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact All users of Nautobot versions earlier than 1.6.6 or 2.0.5 are potentially affected. Due to incorrect usage of Django's `mark_safe()` API when rendering certain types of user-authored content, including: - custom links - job buttons - computed fields it is possible that users with permission to create or edit these types of content could craft a malicious payload (such as JavaScript code) that would be executed when rendering pages containing this content. ### Patches _Has the problem been patched? What versions should users upgrade to?_ We have fixed the incorrect uses of `mark_safe()` (generally by replacing them with appropriate use of `format_html()` instead) to prevent such malicious data from being executed. Users on Nautobot 1.6.x LTM should upgrade to v1.6.6 and users on Nautobot 2.0.x should upgrade to v2.0.5. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ Appropriate object permissions can and should be applied to restrict which users are permitted to create or edit the aforementioned types of user-authored content. Other than that, there is no direct fix available. ### References _Are there any links users can visit to find out more?_ - https://github.com/nautobot/nautobot/pull/4832 - https://github.com/nautobot/nautobot/pull/4833 - https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.html.format_html - https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.safestring.mark_safe

CVE-2023-48705 Affected Nautobot Versions

2 component(s)
Fixed Versions:
1.6.62.0.5
Product / Package Ecosystem Affected Versions Fixed Version
nautobot
PyPI
< 1.6.6
1.6.6
nautobot
PyPI
≥ 2.0.0
< 2.0.5
2.0.5

References

Frequently Asked Questions

What is CVE-2023-48705?
CVE-2023-48705 is a security vulnerability in Nautobot involving Cross-site Scripting potential in custom links, job buttons, and computed fields under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Nautobot versions are affected?
Affected versions include releases prior to 1.6.6, 2.0.5 across affected packages: nautobot.
What version fixes CVE-2023-48705?
Upgrading to 1.6.6, 2.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nautobot affected?
Yes, nautobot is affected in releases prior to 1.6.6, 2.0.5. Upgrade your dependency to 1.6.6, 2.0.5 or later.
What is the CVSS score of CVE-2023-48705?
CVE-2023-48705 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L.
What CWE is associated with CVE-2023-48705?
CVE-2023-48705 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for CVE-2023-48705?
Run the dependency tree command: 'pip show nautobot'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cf9f-wmhp-v4pr",
  "modified" : "2024-11-22T18:13:43Z",
  "published" : "2023-11-22T20:55:54Z",
  "aliases" : [ "CVE-2023-48705" ],
  "summary" : "Cross-site Scripting potential in custom links, job buttons, and computed fields",
  "details" : "### Impact\n\nAll users of Nautobot versions earlier than 1.6.6 or 2.0.5 are potentially affected.\n\nDue to incorrect usage of Django's `mark_safe()` API when rendering certain types of user-authored content, including:\n\n- custom links\n- job buttons\n- computed fields\n\nit is possible that users with permission to create or edit these types of content could craft a malicious payload (such as JavaScript code) that would be executed when rendering pages containing this content.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nWe have fixed the incorrect uses of `mark_safe()` (generally by replacing them with appropriate use of `format_html()` instead) to prevent such malicious data from being executed.\n\nUsers on Nautobot 1.6.x LTM should upgrade to v1.6.6 and users on Nautobot 2.0.x should upgrade to v2.0.5.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nAppropriate object permissions can and should be applied to restrict which users are permitted to create or edit the aforementioned types of user-authored content. Other than that, there is no direct fix available.\n\n### References\n_Are there any links users can visit to find out more?_\n\n- https://github.com/nautobot/nautobot/pull/4832\n- https://github.com/nautobot/nautobot/pull/4833\n- https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.html.format_html\n- https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.safestring.mark_safe",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nautobot"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nautobot"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/security/advisories/GHSA-cf9f-wmhp-v4pr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-48705"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/pull/4832"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/pull/4833"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/commit/362850f5a94689a4c75e3188bf6de826c3b012b2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/commit/54abe23331b6c3d0d82bf1b028c679b1d200920d"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.html.format_html"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.safestring.mark_safe"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nautobot/nautobot"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nautobot/PYSEC-2023-285.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-22T20:55:54Z",
    "nvd_published_at" : "2023-11-22T16:15:09Z"
  }
}