CVE-2026-49245: Github.com/drakkan/sftpgo/v2 Cross-Site Scripting Vulnerability

LOW
Advisory Identifier: GHSA-3vcg-pv95-pq54
CVSS 3.7
CWE-79
Published
Advisory Summary

CVE-2026-49245 is a LOW (CVSS 3.7) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/drakkan/sftpgo/v2 libraries in the Go ecosystem. The issue involves sftpgo has stored xss via inline parameter on public shares and user file download. Remediation is available by upgrading affected packages to version 2.7.3.

CVE-2026-49245 at a Glance

CVE Identifier CVE-2026-49245
GHSA Identifier GHSA-3vcg-pv95-pq54
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/drakkan/sftpgo/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2026-49245

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.3
Upgrade github.com/drakkan/sftpgo/v2 to 2.7.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-2026-49245, 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.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 CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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

## Summary The inline query parameter on the browsable-share file download and on the authenticated user file download suppressed Content-Disposition: attachment, so an HTML file stored in a share or home directory could be served as text/html and execute in SFTPGo's web origin (stored XSS). ## Impact Low. Exploitation requires the attacker to place the file and a victim to open the crafted link — a URL the WebClient never generates, so it requires social engineering — and the practical conditions are narrow: - Session cookies are HttpOnly, so the cookie cannot be read by the injected script. - Authenticated shares set their own session cookie, which overwrites the victim's WebClient cookie, no account pivot. The realistic case is a public share, or a folder shared between distinct users combined with targeted social engineering. It is a genuine trust-boundary violation (SFTPGo emits attacker-controlled content as active HTML in its own origin), hence an advisory, but the constrained preconditions and the HttpOnly mitigation keep it Low. ## Patches Upgrade to v2.7.3. These endpoints now always respond with Content-Disposition: attachment; the inline parameter has been removed. See the fix commit for the full technical rationale.

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

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

References

Frequently Asked Questions

What is CVE-2026-49245?
CVE-2026-49245 is a security vulnerability in Github.com/drakkan/sftpgo/v2 involving SFTPGo has stored XSS via inline parameter on public shares and user file download under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/drakkan/sftpgo/v2 versions are affected?
Affected versions include releases prior to 2.7.3 across affected packages: github.com/drakkan/sftpgo/v2.
What version fixes CVE-2026-49245?
Upgrading to 2.7.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.7.3. Upgrade your dependency to 2.7.3 or later.
What is the CVSS score of CVE-2026-49245?
CVE-2026-49245 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-49245?
CVE-2026-49245 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for CVE-2026-49245?
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-3vcg-pv95-pq54",
  "modified" : "2026-07-02T19:09:30Z",
  "published" : "2026-07-02T19:09:30Z",
  "aliases" : [ "CVE-2026-49245" ],
  "summary" : "SFTPGo has stored XSS via inline parameter on public shares and user file download",
  "details" : "## Summary\n\nThe inline query parameter on the browsable-share file download and on the authenticated user file download suppressed Content-Disposition: attachment, so an HTML file stored in a share or home directory could be served as text/html and execute in SFTPGo's web origin (stored XSS).\n\n## Impact\n\nLow. Exploitation requires the attacker to place the file and a victim to open the crafted link — a URL the WebClient never generates, so it requires social engineering — and the practical conditions are narrow:\n\n- Session cookies are HttpOnly, so the cookie cannot be read by the injected script.\n- Authenticated shares set their own session cookie, which overwrites the victim's WebClient cookie, no account pivot. The realistic case is a public share, or a folder shared between distinct users combined with targeted social engineering.\n\nIt is a genuine trust-boundary violation (SFTPGo emits attacker-controlled content as active HTML in its own origin), hence an advisory, but the constrained preconditions and the HttpOnly mitigation keep it Low.\n\n## Patches\n\nUpgrade to v2.7.3. These endpoints now always respond with Content-Disposition: attachment; the inline parameter has been removed. See the fix commit for the full technical rationale.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/drakkan/sftpgo/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.7.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.7.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/drakkan/sftpgo/security/advisories/GHSA-3vcg-pv95-pq54"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/drakkan/sftpgo"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T19:09:30Z",
    "nvd_published_at" : null
  }
}