CVE-2024-52309: Github.com/drakkan/sftpgo/v2 SFTPGo Allows Administrators To Restrict Vulnerability

MODERATE
Advisory Identifier: GHSA-49cc-xrjf-9qf7
Published
Advisory Summary

CVE-2024-52309 is a MODERATE sftpgo allows administrators to restrict vulnerability (General Security Weakness) affecting Github.com/drakkan/sftpgo/v2 libraries in the Go ecosystem. The issue involves sftpgo allows administrators to restrict command execution from the eventmanager. Remediation is available by upgrading affected packages to version 2.6.3.

CVE-2024-52309 at a Glance

CVE Identifier CVE-2024-52309
GHSA Identifier GHSA-49cc-xrjf-9qf7
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/drakkan/sftpgo/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2024-52309

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.3
Upgrade github.com/drakkan/sftpgo/v2 to 2.6.3
sftpgo fixed: 2.6.3
Upgrade sftpgo to 2.6.3
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-52309, 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.3), 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 General Security Weakness. 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 One powerful feature of SFTPGo is the ability to have the EventManager execute scripts or run applications in response to certain events. This feature is very common in all software similar to SFTPGo and is generally unrestricted. However, any SFTPGo administrator with permission to run a script has access to the underlying OS/container with the same permissions as the user running SFTPGo, so they can access the database and server configurations. This is unexpected for some SFTPGo administrators who think that there is a clear distinction between accessing the system shell and accessing the SFTPGo WebAdmin UI. ### Patches To avoid this confusion, running system commands is now disabled by default, and an allow list has been added so that system administrators configuring SFTPGo must explicitly define which commands are allowed to be configured from the WebAdmin UI. https://github.com/drakkan/sftpgo/commit/88b1850b5806eee81150873d4e565144b21021fb https://github.com/drakkan/sftpgo/commit/b524da11e9466d05fe03304713ee1c61bb276ec4 ### Workarounds Allow EventManager to be used only by SFTPGo administrators who also have shell access.

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

2 component(s)
Fixed Versions:
2.6.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/drakkan/sftpgo/v2
Go
≥ 2.4.0
< 2.6.3
2.6.3
sftpgo
Go
≥ 2.4.0
< 2.6.3
2.6.3

References

Frequently Asked Questions

What is CVE-2024-52309?
CVE-2024-52309 is a security vulnerability in Github.com/drakkan/sftpgo/v2 involving SFTPGo allows administrators to restrict command execution from the EventManager under General Security Weakness.
Which Github.com/drakkan/sftpgo/v2 versions are affected?
Affected versions include releases prior to 2.6.3 across affected packages: github.com/drakkan/sftpgo/v2, sftpgo.
What version fixes CVE-2024-52309?
Upgrading to 2.6.3 (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.3. Upgrade your dependency to 2.6.3 or later.
Is sftpgo affected?
Yes, sftpgo is affected in releases prior to 2.6.3. Upgrade your dependency to 2.6.3 or later.
What CWE is associated with CVE-2024-52309?
CVE-2024-52309 is classified under General Security Weakness.
How can I check Go dependencies for CVE-2024-52309?
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-49cc-xrjf-9qf7",
  "modified" : "2024-12-02T18:04:00Z",
  "published" : "2024-11-21T23:19:07Z",
  "aliases" : [ "CVE-2024-52309" ],
  "summary" : "SFTPGo allows administrators to restrict command execution from the EventManager",
  "details" : "### Impact\n\nOne powerful feature of SFTPGo is the ability to have the EventManager execute scripts or run applications in response to certain events.\nThis feature is very common in all software similar to SFTPGo and is generally unrestricted. \n\nHowever, any SFTPGo administrator with permission to run a script has access to the underlying OS/container with the same permissions as the user running SFTPGo, so they can access the database and server configurations.\n\nThis is unexpected for some SFTPGo administrators who think that there is a clear distinction between accessing the system shell and accessing the SFTPGo WebAdmin UI.\n\n### Patches\n\nTo avoid this confusion, running system commands is now disabled by default, and an allow list has been added so that system administrators configuring SFTPGo must explicitly define which commands are allowed to be configured from the WebAdmin UI.\n\nhttps://github.com/drakkan/sftpgo/commit/88b1850b5806eee81150873d4e565144b21021fb\nhttps://github.com/drakkan/sftpgo/commit/b524da11e9466d05fe03304713ee1c61bb276ec4\n\n### Workarounds\n\nAllow EventManager to be used only by SFTPGo administrators who also have shell access.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/drakkan/sftpgo/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0"
      }, {
        "fixed" : "2.6.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "sftpgo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0"
      }, {
        "fixed" : "2.6.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/security/advisories/GHSA-49cc-xrjf-9qf7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52309"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/commit/88b1850b5806eee81150873d4e565144b21021fb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/commit/b524da11e9466d05fe03304713ee1c61bb276ec4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drakkan/sftpgo"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3283"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-21T23:19:07Z",
    "nvd_published_at" : null
  }
}