Gokapi, Stored XSS Vulnerability, CVE-2025-XXXX (Medium)

Listen to this Post

How the CVE Works:

The vulnerability (CVE-2025-XXXX) in Gokapi versions 1.0.1 to 1.9.6 allows authenticated users to inject malicious JavaScript via the “friendly name” field of API keys. When another user views the API key overview, the stored script executes in their browser session. Since versions below 2.0 lack a permission system, any authenticated user can modify all resources, including encrypted data, as encryption keys are shared globally. Attackers could leverage this XSS for session hijacking, phishing redirects, or crypto-mining payloads.

DailyCVE Form:

Platform: Gokapi
Version: 1.0.1-1.9.6
Vulnerability: Stored XSS
Severity: Medium
Date: Jun 3, 2025

Prediction: Patch expected by Jun 10, 2025

What Undercode Say:

Analytics:

  • Exploit Likelihood: Moderate (requires auth)
  • Attack Surface: Web UI (API key management)
  • Data Exposure: Session tokens, encrypted data

Exploit Example:

// Malicious API key name payload
fetch("/admin/steal_cookie?data=" + document.cookie);

Protection Commands:

1. Upgrade:

wget https://patch.gokapi/v2.0.0 && sudo ./install.sh

2. Mitigation (pre-patch):

Block API key name special chars
location /api/keys {
deny ~[\<>\"\'] /api/keys;
}

3. Log Inspection:

grep -r "friendly_name=" /var/log/gokapi/access.log

Code Fix (Sanitization):

// Patched sanitization in Gokapi v2.0
func sanitizeKeyName(name string) string {
return html.EscapeString(strings.TrimSpace(name))
}

Detection Script:

import requests
def check_xss(url):
payload = "<script>alert(1)</script>"
r = requests.post(url + "/api/keys", data={"name": payload})
return payload in r.text

Post-Patch Audit:

curl -s http://localhost:8080/api/version | grep "2.0.0"

Firewall Rule (Temporary):

iptables -A INPUT -p tcp --dport 8080 -m string --string "<script>" --algo bm -j DROP

Backup Encryption Key:

openssl rand -hex 32 > /etc/gokapi/new_key.bin

End.

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top