CVE-2023-46128: Nautobot Nautobot Vulnerable To Exposure Of Vulnerability

HIGH
Advisory Identifier: GHSA-r2hw-74xv-4gqp
CVSS 7.7
CWE-312 CWE-200 CWE-359
Published
Advisory Summary

CVE-2023-46128 is a HIGH (CVSS 7.7) nautobot vulnerable to exposure of vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting Nautobot libraries in the PyPI ecosystem. The issue involves nautobot vulnerable to exposure of hashed user passwords via rest api. Remediation is available by upgrading affected packages to version 2.0.3.

CVE-2023-46128 at a Glance

CVE Identifier CVE-2023-46128
GHSA Identifier GHSA-r2hw-74xv-4gqp
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-312: Cleartext Storage of Sensitive Information
Affected Product Nautobot
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.7

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

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

How to Fix CVE-2023-46128

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: 2.0.3
pip install nautobot>=2.0.3
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-46128, 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 2.0.3), 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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. 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 In Nautobot 2.0.x, certain REST API endpoints, in combination with the `?depth=<N>` query parameter, can expose hashed user passwords as stored in the database to any authenticated user with access to these endpoints. > The passwords are *not* exposed in plaintext. > Nautobot 1.x is *not* affected by this vulnerability. Example: ``` GET /api/users/permissions/?depth=1 HTTP 200 OK API-Version: 2.0 Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS Content-Type: application/json Vary: Accept ``` ```json { "count": 1, "next": null, "previous": null, "results": [ { "id": "28ea85e4-5039-4389-94f1-9a3e1c787149", "object_type": "users.objectpermission", "display": "Run Job", "url": "http://localhost:8080/api/users/permissions/28ea85e4-5039-4389-94f1-9a3e1c787149/", "natural_slug": "run-job_28ea", "object_types": [ "extras.job" ], "name": "Run Job", "description": "", "enabled": true, "actions": [ "run", "view" ], "constraints": null, "groups": [ { "id": 1, "object_type": "auth.group", "display": "A Group", "url": "http://localhost:8080/api/users/groups/1/", "natural_slug": "a-group_1", "name": "A Group" } ], "users": [ { "id": "e73288e2-1326-4bfb-8fea-041290dd7473", "object_type": "users.user", "display": "admin", "url": "http://localhost:8080/api/users/users/e73288e2-1326-4bfb-8fea-041290dd7473/", "natural_slug": "admin_e732", "password": "pbkdf2_sha256$260000$jQb7hA48HYJ0MLWQgOZiBl$b72+gz6SpZiRpxceRQfT5Zv/aUac0eJ4NdBTZ8ECOow=", "last_login": "2023-10-18T14:19:08.780857Z", "is_superuser": true, "username": "admin", "first_name": "", "last_name": "", "email": "", "is_staff": true, "is_active": true, "date_joined": "2023-10-18T14:18:55.854023Z", "config_data": {} } ] } ] } ``` > Note the "password" field present in the nested `"users"` data. This information is not exposed during direct access to the `/api/users/users/` endpoint, but can be exposed through any endpoint which contains a nested reference to User object(s) when an appropriate `?depth=<N>` query parameter is specified. Known impacted endpoints include: - `/api/dcim/rack-reservations/?depth=1`(or any greater `depth` value) - `/api/extras/job-results/?depth=1` (or any greater `depth` value) - `/api/extras/notes/?depth=1` (or any greater `depth` value) - `/api/extras/object-changes/?depth=1` (or any greater `depth` value) - `/api/extras/scheduled-jobs/?depth=1` (or any greater `depth` value) - `/api/users/permissions/?depth=1` (or any greater `depth` value) but this is not necessarily an exhaustive list. > Plugin REST API endpoints for any models with a foreign key to the User model may also be impacted by this issue. > The patch identified below mitigates the issue for both Nautobot core REST APIs and plugin REST APIs; no code change in plugins is required to address this issue. ### Patches Refer to https://github.com/nautobot/nautobot/pull/4692 for the patch that resolved this issue. ### Workarounds Upgrading to v2.0.3 or later, or applying the above patch, is the preferred workaround for this issue; while it could also be partially mitigated by updating permissions to deny user access to the above list of impacted REST API endpoints, that is not recommended as other endpoints may also expose this issue until patched. ### References https://github.com/nautobot/nautobot/pull/4692

CVE-2023-46128 Affected Nautobot Versions

1 component(s)
Fixed Versions:
2.0.3
Product / Package Ecosystem Affected Versions Fixed Version
nautobot
PyPI
≥ 2.0.0
< 2.0.3
2.0.3

References

Frequently Asked Questions

What is CVE-2023-46128?
CVE-2023-46128 is a security vulnerability in Nautobot involving Nautobot vulnerable to exposure of hashed user passwords via REST API under CWE-312: Cleartext Storage of Sensitive Information.
Which Nautobot versions are affected?
Affected versions include releases prior to 2.0.3 across affected packages: nautobot.
What version fixes CVE-2023-46128?
Upgrading to 2.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nautobot affected?
Yes, nautobot is affected in releases prior to 2.0.3. Upgrade your dependency to 2.0.3 or later.
What is the CVSS score of CVE-2023-46128?
CVE-2023-46128 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-46128?
CVE-2023-46128 is classified under CWE-312: Cleartext Storage of Sensitive Information (The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.).
How can I check PyPI dependencies for CVE-2023-46128?
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-r2hw-74xv-4gqp",
  "modified" : "2024-10-07T15:09:56Z",
  "published" : "2023-10-24T19:25:24Z",
  "aliases" : [ "CVE-2023-46128" ],
  "summary" : "Nautobot vulnerable to exposure of hashed user passwords via REST API",
  "details" : "### Impact\n\nIn Nautobot 2.0.x, certain REST API endpoints, in combination with the `?depth=<N>` query parameter, can expose hashed user passwords as stored in the database to any authenticated user with access to these endpoints. \n\n> The passwords are *not* exposed in plaintext. \n> Nautobot 1.x is *not* affected by this vulnerability.\n\nExample:\n\n```\nGET /api/users/permissions/?depth=1\n\nHTTP 200 OK\nAPI-Version: 2.0\nAllow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n```\n\n```json\n{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": \"28ea85e4-5039-4389-94f1-9a3e1c787149\",\n            \"object_type\": \"users.objectpermission\",\n            \"display\": \"Run Job\",\n            \"url\": \"http://localhost:8080/api/users/permissions/28ea85e4-5039-4389-94f1-9a3e1c787149/\",\n            \"natural_slug\": \"run-job_28ea\",\n            \"object_types\": [\n                \"extras.job\"\n            ],\n            \"name\": \"Run Job\",\n            \"description\": \"\",\n            \"enabled\": true,\n            \"actions\": [\n                \"run\",\n                \"view\"\n            ],\n            \"constraints\": null,\n            \"groups\": [\n                {\n                    \"id\": 1,\n                    \"object_type\": \"auth.group\",\n                    \"display\": \"A Group\",\n                    \"url\": \"http://localhost:8080/api/users/groups/1/\",\n                    \"natural_slug\": \"a-group_1\",\n                    \"name\": \"A Group\"\n                }\n            ],\n            \"users\": [\n                {\n                    \"id\": \"e73288e2-1326-4bfb-8fea-041290dd7473\",\n                    \"object_type\": \"users.user\",\n                    \"display\": \"admin\",\n                    \"url\": \"http://localhost:8080/api/users/users/e73288e2-1326-4bfb-8fea-041290dd7473/\",\n                    \"natural_slug\": \"admin_e732\",\n                    \"password\": \"pbkdf2_sha256$260000$jQb7hA48HYJ0MLWQgOZiBl$b72+gz6SpZiRpxceRQfT5Zv/aUac0eJ4NdBTZ8ECOow=\",\n                    \"last_login\": \"2023-10-18T14:19:08.780857Z\",\n                    \"is_superuser\": true,\n                    \"username\": \"admin\",\n                    \"first_name\": \"\",\n                    \"last_name\": \"\",\n                    \"email\": \"\",\n                    \"is_staff\": true,\n                    \"is_active\": true,\n                    \"date_joined\": \"2023-10-18T14:18:55.854023Z\",\n                    \"config_data\": {}\n                }\n            ]\n        }\n    ]\n}\n```\n\n> Note the \"password\" field present in the nested `\"users\"` data.\n\nThis information is not exposed during direct access to the `/api/users/users/` endpoint, but can be exposed through any endpoint which contains a nested reference to User object(s) when an appropriate `?depth=<N>` query parameter is specified. Known impacted endpoints include:\n\n- `/api/dcim/rack-reservations/?depth=1`(or any greater `depth` value)\n- `/api/extras/job-results/?depth=1` (or any greater `depth` value)\n- `/api/extras/notes/?depth=1` (or any greater `depth` value)\n- `/api/extras/object-changes/?depth=1` (or any greater `depth` value)\n- `/api/extras/scheduled-jobs/?depth=1` (or any greater `depth` value)\n- `/api/users/permissions/?depth=1` (or any greater `depth` value)\n\nbut this is not necessarily an exhaustive list. \n\n> Plugin REST API endpoints for any models with a foreign key to the User model may also be impacted by this issue.\n\n> The patch identified below mitigates the issue for both Nautobot core REST APIs and plugin REST APIs; no code change in plugins is required to address this issue.\n\n### Patches\n\nRefer to https://github.com/nautobot/nautobot/pull/4692 for the patch that resolved this issue.\n\n### Workarounds\n\nUpgrading to v2.0.3 or later, or applying the above patch, is the preferred workaround for this issue; while it could also be partially mitigated by updating permissions to deny user access to the above list of impacted REST API endpoints, that is not recommended as other endpoints may also expose this issue until patched.\n\n### References\n\nhttps://github.com/nautobot/nautobot/pull/4692\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nautobot"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/security/advisories/GHSA-r2hw-74xv-4gqp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46128"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/pull/4692"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nautobot/nautobot/commit/1ce8e5c658a075c29554d517cd453675e5d40d71"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nautobot/nautobot"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nautobot/PYSEC-2023-220.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-312", "CWE-359" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-24T19:25:24Z",
    "nvd_published_at" : "2023-10-25T18:17:36Z"
  }
}