Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-48495 Overview
Gokapi is a self-hosted file sharing server offering automatic expiration and encryption. CVE-2025-48495 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] affecting Gokapi versions prior to 2.0.0. An authenticated user can inject JavaScript into the friendly name field of an API key. The payload executes in another user's browser when they open the API key overview tab. Prior to 2.0.0, Gokapi had no user permission system, so all authenticated users shared access to resources and encryption keys. Single-user deployments are not affected. The maintainer fixed the issue in version 2.0.0.
Critical Impact
An authenticated user can execute arbitrary JavaScript in another authenticated user's browser session, enabling session abuse and unauthorized actions within the shared Gokapi instance.
Affected Products
- Forceu Gokapi versions prior to 2.0.0
- Forceu Gokapi 2.0.0 beta1
- Forceu Gokapi 2.0.0 beta2
Discovery Timeline
- 2025-06-02 - CVE-2025-48495 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-48495
Vulnerability Analysis
The vulnerability is a stored XSS in the Gokapi web interface. When an authenticated user renames the friendly name of an API key, the application stores the attacker-supplied value without sufficient output encoding. The malicious value is later rendered on the API key overview page. Any other authenticated user visiting that page triggers execution of the injected JavaScript in their session context.
Because Gokapi before 2.0.0 lacked a permission model, every authenticated user could view and modify shared resources. The shared symmetric encryption key further meant end-to-end encrypted files offered no protection between users. XSS execution in a victim's browser therefore grants access to the same resources the victim can reach, including API keys, uploaded files, and administrative actions.
Root Cause
The root cause is improper neutralization of input during web page generation [CWE-79]. The API key friendly name is treated as trusted markup rather than text when rendered in the overview template. Combined with the absence of a user permission boundary, the issue allows cross-user compromise within a single Gokapi deployment.
Attack Vector
Exploitation requires authentication to the Gokapi instance and user interaction from a second authenticated victim who opens the API tab. The attacker creates or renames an API key, embedding a JavaScript payload in the friendly name field. When another user navigates to the API key overview, the payload executes and can perform actions on behalf of the victim, including creating or exfiltrating API keys, downloading shared files, or modifying configuration.
No verified public exploit code is available. Review the GitHub Security Advisory GHSA-4xg4-54hm-9j77 for maintainer-provided technical details.
Detection Methods for CVE-2025-48495
Indicators of Compromise
- API key entries whose friendly name contains HTML tags, <script> fragments, event handlers such as onerror= or onload=, or javascript: URIs.
- Unexpected outbound requests from browsers of Gokapi administrators shortly after they open the API key overview page.
- Creation of new API keys or modification of existing keys by accounts that do not normally perform those actions.
Detection Strategies
- Query the Gokapi configuration or database for API key friendly name fields and alert on values containing HTML or JavaScript syntax.
- Inspect reverse proxy or web server access logs for POST or PUT requests to API key rename endpoints with payloads containing script-like characters.
- Monitor browser DOM telemetry or Content Security Policy (CSP) violation reports from users accessing the Gokapi management interface.
Monitoring Recommendations
- Forward Gokapi access logs and application logs to a centralized logging platform for continuous review of authentication and API key changes.
- Alert on administrative actions originating from unusual IP addresses or user-agent strings during known XSS-exposed sessions.
- Track upgrades across Gokapi deployments to confirm all instances are running version 2.0.0 or later.
How to Mitigate CVE-2025-48495
Immediate Actions Required
- Upgrade all Gokapi instances to version 2.0.0 or later, which contains the fix.
- Audit existing API key friendly names for suspicious content and remove or rename any entries containing HTML or JavaScript.
- Rotate API keys and session tokens if evidence of exploitation is identified.
Patch Information
The maintainer addressed the issue in Gokapi 2.0.0. The fix is documented in the upstream commit 65ddbc6 and the GitHub Security Advisory GHSA-4xg4-54hm-9j77. Version 2.0.0 also introduces a user permission system that limits cross-user resource access.
Workarounds
- Avoid opening the API page in Gokapi versions prior to 2.0.0 if another user may have modified API key names.
- Restrict Gokapi access to a single trusted operator until the upgrade is applied; single-user deployments are not affected.
- Place Gokapi behind a reverse proxy that enforces a strict Content Security Policy to limit inline script execution.
# Example restrictive Content-Security-Policy header for a reverse proxy
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always;
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

