CVE-2025-48495 Gokapi has stored XSS vulnerability in friendly name for API keys

Medium 4.8 Published Updated

Authenticated users can inject JavaScript via API key names, leading to code execution in other users' browsers.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-48495?

CVE-2025-48495 is a medium-severity cross-site scripting vulnerability in Forceu Gokapi, published on 2 Jun 2025. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

Gokapi is a self-hosted file sharing server with automatic expiration and encryption support. By renaming the friendly name of an API key, an authenticated user could inject JS into the API key overview, which would also be executed when another user clicks on his API tab. 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 of versions 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 workaround would be to not open the API page if it is possible that another user might have injected code.

Weakness: CWE-87, CWE-79

Which versions are affected by CVE-2025-48495?

5 open source packages ship an affected version, including github.com/forceu/gokapi. It affects 1 product.

PackageAffectedFixed in
github.com/forceu/gokapi GoAll versionsNone
github.com/forceu/gokapi GoAll versions0.0.0-20250530185940-65ddbc68fbfd
github.com/forceu/gokapi GoAll versions0.0.0-20250530185940-65ddbc68fbfd
github.com/forceu/gokapi GoFrom 1.0.1 to 1.9.6None
github.com/forceu/gokapi GoFrom 1.0.1 to 1.9.6None

Products include Forceu Gokapi.

How do I fix CVE-2025-48495?

Upgrade github.com/forceu/gokapi to 0.0.0-20250530185940-65ddbc68fbfd or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-48495 being exploited?

There is no known exploitation of CVE-2025-48495 in the wild and no public exploit code.

Sources

Also known as GHSA-4xg4-54hm-9j77, GO-2025-3736.

Is CVE-2025-48495 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free