CVE-2024-37897: Github.com/drakkan/sftpgo/v2 SFTPGo Has Insufficient Access Control Vulnerability

MODERATE
Advisory Identifier: GHSA-hw5f-6wvv-xcrh
CVSS 6.5
CWE-287 CWE-863
Published
Advisory Summary

CVE-2024-37897 is a MODERATE (CVSS 6.5) sftpgo has insufficient access control vulnerability (CWE-287: Improper Authentication) affecting Github.com/drakkan/sftpgo/v2 libraries in the Go ecosystem. The issue involves sftpgo has insufficient access control for password reset. Remediation is available by upgrading affected packages to version 2.6.1.

CVE-2024-37897 at a Glance

CVE Identifier CVE-2024-37897
GHSA Identifier GHSA-hw5f-6wvv-xcrh
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/drakkan/sftpgo/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2024-37897

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

github.com/drakkan/sftpgo/v2 fixed: 2.6.1
Upgrade github.com/drakkan/sftpgo/v2 to 2.6.1
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/drakkan/sftpgo/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-37897, inspect your project dependencies for Github.com/drakkan/sftpgo/v2:

inspect dependencies for github.com/drakkan/sftpgo/v2

Analyze the terminal output to locate any version of Github.com/drakkan/sftpgo/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/drakkan/sftpgo/v2, 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 SFTPGo WebAdmin and WebClient support password reset. This feature is disabled in the default configuration. In SFTPGo versions prior to v2.6.1, if the feature is enabled, even users with access restrictions (e.g. expired) can reset their password and log in. ### Patches Fixed in v2.6.1. ### Workarounds The following workarounds are available: - keep the password reset feature disabled. - Set a blank email address for users and admins with access restrictions so they cannot receive the email with the reset code and exploit the vulnerability.

CVE-2024-37897 Affected Github.com/drakkan/sftpgo/v2 Versions

1 component(s)
Fixed Versions:
2.6.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/drakkan/sftpgo/v2
Go
≥ 2.2.0
< 2.6.1
2.6.1

References

Frequently Asked Questions

What is CVE-2024-37897?
CVE-2024-37897 is a security vulnerability in Github.com/drakkan/sftpgo/v2 involving SFTPGo has insufficient access control for password reset under CWE-287: Improper Authentication.
Which Github.com/drakkan/sftpgo/v2 versions are affected?
Affected versions include releases prior to 2.6.1 across affected packages: github.com/drakkan/sftpgo/v2.
What version fixes CVE-2024-37897?
Upgrading to 2.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/drakkan/sftpgo/v2 affected?
Yes, github.com/drakkan/sftpgo/v2 is affected in releases prior to 2.6.1. Upgrade your dependency to 2.6.1 or later.
What is the CVSS score of CVE-2024-37897?
CVE-2024-37897 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-37897?
CVE-2024-37897 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2024-37897?
Run the dependency tree command: 'inspect dependencies for github.com/drakkan/sftpgo/v2'. 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-hw5f-6wvv-xcrh",
  "modified" : "2024-06-20T19:16:28Z",
  "published" : "2024-06-20T16:11:48Z",
  "aliases" : [ "CVE-2024-37897" ],
  "summary" : "SFTPGo has insufficient access control for password reset",
  "details" : "### Impact\n\nSFTPGo WebAdmin and WebClient support password reset. This feature is disabled in the default configuration.\nIn SFTPGo versions prior to v2.6.1, if the feature is enabled, even users with access restrictions (e.g. expired) can reset their password and log in.\n\n### Patches\n\nFixed in v2.6.1.\n\n### Workarounds\n\nThe following workarounds are available:\n\n- keep the password reset feature disabled.\n- Set a blank email address for users and admins with access restrictions so they cannot receive the email with the reset code and exploit the vulnerability.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/drakkan/sftpgo/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/security/advisories/GHSA-hw5f-6wvv-xcrh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37897"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/commit/1f8ac8bfe16100b0484d6c91e1e8361687324423"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/commit/3462bba3f41cbc75486474991b9e3ac1b5f1e583"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drakkan/sftpgo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/releases/tag/v2.6.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-20T16:11:48Z",
    "nvd_published_at" : "2024-06-20T18:15:13Z"
  }
}