Gokapi vulnerable to stored XSS via uploading file with malicious file name

Description

Impact

When using end-to-end encryption, a stored XSS vulnerability can be exploited by uploading a file with JavaScript code embedded in the filename. After upload and every time someone opens the upload list, the script is then parsed.

With the affected versions <v2.0, there was no user permission system implemented, therefore all authenticated users were already able to see and modify all resources, even if end-to-end encrypted, as the encryption key had to be the same for all users with <v2.0. Nethertheless with XSS, other attack vectors like redirection or crypto mining would be possble.

Patches

This CVE has been fixed in v2.0.0

Workarounds

If you are the only authenticated user using Gokapi, you are not affected. A workaround would be to disable end-to-end encryption.

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2025-06-03 06:28:08 UTC
Updated
2025-08-26 20:09:21 UTC
GitHub reviewed
2025-06-03 06:28:08 UTC
NVD published
2025-06-02

EPSS Score

Score Percentile
0.08% 23.02%

CVSS Scores

Base score Version Severity Vector
4.8 4.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:N)
No additional preconditions are required beyond normal reachability.
Privileges required (PR:H)
High privileges are required.
User interaction (UI:P)
A user has to participate (for example click/open/approve).
Vulnerable system confidentiality impact (VC:N)
No confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:N)
No availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:L)
Limited confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:L)
Limited integrity impact on subsequent systems.
Subsequent system availability impact (SA:L)
Limited availability impact on subsequent systems.

Identifiers

CWEs

CWE id Name
CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CWE-87 Improper Neutralization of Alternate XSS Syntax

Credits

  • 4rdr (reporter)
  • Forceu (remediation_developer)

Affected packages (2)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
go github.com/forceu/gokapi >= 1.0.1, <= 1.9.6
go github.com/forceu/gokapi < 0.0.0-20250530191232-343cc566cfd7 0.0.0-20250530191232-343cc566cfd7

References

cvelogic Threat Intelligence