CVE-2024-52801: Github.com/drakkan/sftpgo/v2 Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-6943-qr24-82vx
CWE-327
Published
Advisory Summary

CVE-2024-52801 is a MODERATE remote code execution vulnerability (CWE-327: Use of a Broken or Risky Cryptographic Algorithm) affecting Github.com/drakkan/sftpgo/v2 libraries in the Go ecosystem. The issue involves sftpgo vulnerable to brute force takeover of openid connect session cookies. Remediation is available by upgrading affected packages to version 2.6.4.

CVE-2024-52801 at a Glance

CVE Identifier CVE-2024-52801
GHSA Identifier GHSA-6943-qr24-82vx
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-327: Use of a Broken or Risky Cryptographic Algorithm
Affected Product Github.com/drakkan/sftpgo/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2024-52801

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.4
Upgrade github.com/drakkan/sftpgo/v2 to 2.6.4
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-52801, 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.4), 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-327: Use of a Broken or Risky Cryptographic Algorithm, where the product uses a broken or risky cryptographic algorithm or protocol. 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 The OpenID Connect implementation, in the affected SFTPGo versions, allows authenticated users to brute force session cookies and thereby gain access to other users' data, since the cookies are generated predictably using the [xid](https://github.com/rs/xid) library and are therefore unique but not cryptographically secure. ### Patches This issue was fixed in version v2.6.4, where cookies are opaque and cryptographically secure strings. ### References https://github.com/drakkan/sftpgo/commit/f30a9a2095bf90c0661b04fe038e3b7efc788bc6

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

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

References

Frequently Asked Questions

What is CVE-2024-52801?
CVE-2024-52801 is a security vulnerability in Github.com/drakkan/sftpgo/v2 involving sftpgo vulnerable to brute force takeover of OpenID Connect session cookies under CWE-327: Use of a Broken or Risky Cryptographic Algorithm.
Which Github.com/drakkan/sftpgo/v2 versions are affected?
Affected versions include releases prior to 2.6.4 across affected packages: github.com/drakkan/sftpgo/v2.
What version fixes CVE-2024-52801?
Upgrading to 2.6.4 (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.4. Upgrade your dependency to 2.6.4 or later.
What CWE is associated with CVE-2024-52801?
CVE-2024-52801 is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm (The product uses a broken or risky cryptographic algorithm or protocol.).
How can I check Go dependencies for CVE-2024-52801?
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-6943-qr24-82vx",
  "modified" : "2024-12-02T22:05:00Z",
  "published" : "2024-12-02T17:16:34Z",
  "aliases" : [ "CVE-2024-52801" ],
  "summary" : "sftpgo vulnerable to brute force takeover of OpenID Connect session cookies",
  "details" : "### Impact\n\nThe OpenID Connect implementation, in the affected SFTPGo versions, allows authenticated users to brute force session cookies and thereby gain access to other users' data, since the cookies are generated predictably using the [xid](https://github.com/rs/xid) library and are therefore unique but not cryptographically secure.\n\n### Patches\n\nThis issue was fixed in version v2.6.4, where cookies are opaque and cryptographically secure strings.\n\n### References\n\nhttps://github.com/drakkan/sftpgo/commit/f30a9a2095bf90c0661b04fe038e3b7efc788bc6\n",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/drakkan/sftpgo/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.6.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/security/advisories/GHSA-6943-qr24-82vx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52801"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/commit/f30a9a2095bf90c0661b04fe038e3b7efc788bc6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drakkan/sftpgo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rs/xid"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-327" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-02T17:16:34Z",
    "nvd_published_at" : "2024-11-29T19:15:08Z"
  }
}