CVE-2026-30915: Github.com/drakkan/sftpgo/v2 SFTPGo Improperly Sanitizes Placeholders Vulnerability

MODERATE
Advisory Identifier: GHSA-m83q-5wr4-4gfp
CWE-20 CWE-22
Published
Advisory Summary

CVE-2026-30915 is a MODERATE sftpgo improperly sanitizes placeholders vulnerability (CWE-20: Improper Input Validation) affecting Github.com/drakkan/sftpgo/v2 libraries in the Go ecosystem. The issue involves sftpgo improperly sanitizes placeholders in group home directories/key prefixes. Remediation is available by upgrading affected packages to version 2.7.1.

CVE-2026-30915 at a Glance

CVE Identifier CVE-2026-30915
GHSA Identifier GHSA-m83q-5wr4-4gfp
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/drakkan/sftpgo/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-30915

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.7.1
Upgrade github.com/drakkan/sftpgo/v2 to 2.7.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-2026-30915, 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.7.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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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 versions before v2.7.1 contain an input validation issue in the handling of dynamic group paths, for example, home directories or key prefixes. When a group is configured with a dynamic home directory or key prefix using placeholders like `%username%`, the value replacing the placeholder is not strictly sanitized against relative path components. Consequently, if a user is created with a specially crafted username the resulting path may resolve to a parent directory instead of the intended sub-directory. ### Patches This issue is fixed in version v2.7.1

CVE-2026-30915 Affected Github.com/drakkan/sftpgo/v2 Versions

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

References

Frequently Asked Questions

What is CVE-2026-30915?
CVE-2026-30915 is a security vulnerability in Github.com/drakkan/sftpgo/v2 involving SFTPGo improperly sanitizes placeholders in group home directories/key prefixes under CWE-20: Improper Input Validation.
Which Github.com/drakkan/sftpgo/v2 versions are affected?
Affected versions include releases prior to 2.7.1 across affected packages: github.com/drakkan/sftpgo/v2.
What version fixes CVE-2026-30915?
Upgrading to 2.7.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.7.1. Upgrade your dependency to 2.7.1 or later.
What CWE is associated with CVE-2026-30915?
CVE-2026-30915 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2026-30915?
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-m83q-5wr4-4gfp",
  "modified" : "2026-03-24T21:00:13Z",
  "published" : "2026-03-13T18:56:14Z",
  "aliases" : [ "CVE-2026-30915" ],
  "summary" : "SFTPGo improperly sanitizes placeholders in group home directories/key prefixes",
  "details" : "### Impact\n\nSFTPGo versions before v2.7.1 contain an input validation issue in the handling of dynamic group paths, for example, home directories or key prefixes.\n\nWhen a group is configured with a dynamic home directory or key prefix using placeholders like `%username%`, the value replacing the placeholder is not strictly sanitized against relative path components. Consequently, if a user is created with a specially crafted username the resulting path may resolve to a parent directory instead of the intended sub-directory.\n\n### Patches\n\nThis issue is fixed in version v2.7.1",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/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.3.0"
      }, {
        "fixed" : "2.7.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.7.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/security/advisories/GHSA-m83q-5wr4-4gfp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-30915"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drakkan/sftpgo"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2026-4697"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-13T18:56:14Z",
    "nvd_published_at" : "2026-03-13T19:54:35Z"
  }
}