CVE-2025-48494
JSON

4.8medium

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

Severity
4.8medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.31% (higher than 17% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-95rc-wc32-gm53GO-2025-3737

Description

Gokapi is a self-hosted file sharing server with automatic expiration and encryption support. When using end-to-end encryption, a stored cross-site scripting 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. Prior to version 2.0.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 using a version prior to 2.0.0. If a user is the only authenticated user using Gokapi, they are not affected. This issue has been fixed in v2.0.0. A possible workaround would be to disable end-to-end encryption.

Affected

Product or packageVersionsReported by
Forceu Gokapi< 2.0.0, before 2.0.0, 2.0.0CVE List, NVD
github.com/forceu/gokapi (Go)from 1.0.1 up to 1.9.6, before 0.0.0-20250530191232-343cc566cfd7, all versionsGitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M4.8medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L
NVD5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79CWE-87

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Gokapi is a self-hosted file sharing server with automatic expiration and encryption support. When using end-to-end encryption, a stored cross-site scripting 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. Prior to version 2.0.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 using a version prior to 2.0.0. If a user is the only authenticated user using Gokapi, they are not affected. This issue has been fixed in v2.0.0. A possible workaround would be to disable end-to-end encryption.

GitHub Advisory Database
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.

Go Vulnerability Database

Gokapi vulnerable to stored XSS via uploading file with malicious file name in github.com/forceu/gokapi.

NOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.

(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)

The additional affected modules and versions are: github.com/forceu/gokapi before v2.0.0.

NVD (es)

Gokapi es un servidor de intercambio de archivos autoalojado con expiración automática y compatibilidad con cifrado. Al usar cifrado de extremo a extremo, se puede explotar una vulnerabilidad de cross-site-scripting almacenado al subir un archivo con código JavaScript incrustado en el nombre. Tras la subida, y cada vez que alguien abre la lista de subidas, se analiza el script. Antes de la versión 2.0.0, no se implementaba un sistema de permisos de usuario, por lo que todos los usuarios autenticados podían ver y modificar todos los recursos, incluso con cifrado de extremo a extremo, ya que la clave de cifrado debía ser la misma para todos los usuarios de una versión anterior a la 2.0.0. Si un usuario es el único autenticado que usa Gokapi, no se ve afectado. Este problema se ha solucionado en la versión 2.0.0. Un posible workaround sería desactivar el cifrado de extremo a extremo.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-48494 changed 2025-06-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-95rc-wc32-gm53 changed 2025-08-26CC-BY-4.0
Go Vulnerability DatabaseGO-2025-3737 changed 2025-06-03CC-BY-4.0
NVDCVE-2025-48494 changed 2026-06-17Public domain