CVE-2024-34707: Nautobot Nautobot's BANNER_* Configuration Can Be Vulnerability

HIGH
Advisory Identifier: GHSA-r2hr-4v48-fjv3
CVSS 7.5
CWE-79
Published
Advisory Summary

CVE-2024-34707 is a HIGH (CVSS 7.5) nautobot's banner_* configuration can be vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Nautobot libraries in the PyPI ecosystem. The issue involves nautobot's banner_* configuration can be used to inject arbitrary html content into nautobot pages. Remediation is available by upgrading affected packages to version 1.6.22, 2.2.4.

CVE-2024-34707 at a Glance

CVE Identifier CVE-2024-34707
GHSA Identifier GHSA-r2hr-4v48-fjv3
Severity HIGH
CVSS v3.1 Base Score 7.5
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.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
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-2024-34707

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.22
pip install nautobot>=1.6.22
nautobot fixed: 2.2.4
pip install nautobot>=2.2.4
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-2024-34707, 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.22), 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 A Nautobot user with admin privileges can modify the `BANNER_TOP`, `BANNER_BOTTOM`, and `BANNER_LOGIN` configuration settings via the `/admin/constance/config/` endpoint. Normally these settings are used to provide custom banner text at the top and bottom of all Nautobot web pages (or specifically on the login page in the case of `BANNER_LOGIN`) but it was reported that an admin user can make use of these settings to inject arbitrary HTML, potentially exposing Nautobot users to security issues such as cross-site scripting (stored XSS). ### Patches _Has the problem been patched? What versions should users upgrade to?_ Patches will be released as part of Nautobot 1.6.22 and 2.2.4. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ As [described in the Nautobot documentation](https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/configuration/optional-settings/#administratively-configurable-settings), these settings are only configurable through the admin UI of Nautobot if they are *not* explicitly set to some non-empty value in the `nautobot_config.py` or equivalent Nautobot configuration file. Therefore, adding the following configuration to said file completely mitigates this vulnerability in both Nautobot 1.x and 2.x: ```python BANNER_LOGIN = " " BANNER_TOP = " " BANNER_BOTTOM = " " ``` or alternately (Nautobot 2.x only), if those variables are not defined explicitly in your configuration file, setting the following environment variables for the Nautobot user account serves the same purpose: ```shell NAUTOBOT_BANNER_LOGIN=" " NAUTOBOT_BANNER_TOP=" " NAUTOBOT_BANNER_BOTTOM=" " ``` Limiting all users who do not need elevated privileges to non-admin access (`is_superuser: False` and `is_staff: False`) is a partial mitigation as well. ### References - https://github.com/nautobot/nautobot/pull/5697 - https://github.com/nautobot/nautobot/pull/5698

CVE-2024-34707 Affected Nautobot Versions

2 component(s)
Fixed Versions:
1.6.222.2.4
Product / Package Ecosystem Affected Versions Fixed Version
nautobot
PyPI
< 1.6.22
1.6.22
nautobot
PyPI
≥ 2.0.0
< 2.2.4
2.2.4

References

Frequently Asked Questions

What is CVE-2024-34707?
CVE-2024-34707 is a security vulnerability in Nautobot involving Nautobot's BANNER_* configuration can be used to inject arbitrary HTML content into Nautobot pages 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.22, 2.2.4 across affected packages: nautobot.
What version fixes CVE-2024-34707?
Upgrading to 1.6.22, 2.2.4 (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.22, 2.2.4. Upgrade your dependency to 1.6.22, 2.2.4 or later.
What is the CVSS score of CVE-2024-34707?
CVE-2024-34707 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:L.
What CWE is associated with CVE-2024-34707?
CVE-2024-34707 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-2024-34707?
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-r2hr-4v48-fjv3",
  "modified" : "2024-05-14T20:04:15Z",
  "published" : "2024-05-13T19:59:26Z",
  "aliases" : [ "CVE-2024-34707" ],
  "summary" : "Nautobot's BANNER_* configuration can be used to inject arbitrary HTML content into Nautobot pages",
  "details" : "### Impact\n\nA Nautobot user with admin privileges can modify the `BANNER_TOP`, `BANNER_BOTTOM`, and `BANNER_LOGIN` configuration settings via the `/admin/constance/config/` endpoint. Normally these settings are used to provide custom banner text at the top and bottom of all Nautobot web pages (or specifically on the login page in the case of `BANNER_LOGIN`) but it was reported that an admin user can make use of these settings to inject arbitrary HTML, potentially exposing Nautobot users to security issues such as cross-site scripting (stored XSS).\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nPatches will be released as part of Nautobot 1.6.22 and 2.2.4.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nAs [described in the Nautobot documentation](https://docs.nautobot.com/projects/core/en/stable/user-guide/administration/configuration/optional-settings/#administratively-configurable-settings), these settings are only configurable through the admin UI of Nautobot if they are *not* explicitly set to some non-empty value in the `nautobot_config.py` or equivalent Nautobot configuration file. Therefore, adding the following configuration to said file completely mitigates this vulnerability in both Nautobot 1.x and 2.x:\n\n```python\nBANNER_LOGIN = \" \"\nBANNER_TOP = \" \"\nBANNER_BOTTOM = \" \"\n```\n\nor alternately (Nautobot 2.x only), if those variables are not defined explicitly in your configuration file, setting the following environment variables for the Nautobot user account serves the same purpose:\n\n```shell\nNAUTOBOT_BANNER_LOGIN=\" \"\nNAUTOBOT_BANNER_TOP=\" \"\nNAUTOBOT_BANNER_BOTTOM=\" \"\n```\n\nLimiting all users who do not need elevated privileges to non-admin access (`is_superuser: False` and `is_staff: False`) is a partial mitigation as well.\n\n\n### References\n\n- https://github.com/nautobot/nautobot/pull/5697\n- https://github.com/nautobot/nautobot/pull/5698",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/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.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nautobot"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/security/advisories/GHSA-r2hr-4v48-fjv3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-34707"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/pull/5697"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/pull/5698"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/commit/4f0a66bd6307bfe0e0acb899233e0d4ad516f51c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/commit/f640aedc69c848d3d1be57f0300fc40033ff6423"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nautobot/nautobot"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-13T19:59:26Z",
    "nvd_published_at" : "2024-05-14T15:39:30Z"
  }
}