CVE-2025-40616

6.1 MEDIUM

📋 TL;DR

This reflected XSS vulnerability in Bookgy allows attackers to inject malicious JavaScript via the IDRESERVA parameter in /bkg_imprimir_comprobante.php. When victims click a specially crafted link, the attacker can steal session cookies, redirect users, or perform actions on their behalf. Any Bookgy installation with this vulnerable endpoint exposed is affected.

💻 Affected Systems

Products:
  • Bookgy
Versions: Unknown specific versions - all versions with vulnerable endpoint
Operating Systems: All operating systems running Bookgy
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the bkg_imprimir_comprobante.php endpoint with IDRESERVA parameter. No specific version information provided in reference.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attacker steals administrator session cookies, gains full administrative access to the Bookgy system, manipulates booking data, or installs backdoors.

🟠

Likely Case

Attacker steals user session cookies to hijack accounts, redirects users to phishing sites, or performs limited actions within the application.

🟢

If Mitigated

With proper input validation and output encoding, the malicious script is neutralized before reaching the victim's browser.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Reflected XSS vulnerabilities are commonly weaponized. Attack requires victim to click malicious link but no authentication needed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://www.incibe.es/en/incibe-cert/notices/aviso/multiple-vulnerabilities-bookgy

Restart Required: No

Instructions:

1. Check vendor advisory for patch availability. 2. If patch exists, download and apply to Bookgy installation. 3. Validate fix by testing the vulnerable endpoint.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement server-side validation to sanitize IDRESERVA parameter

Modify bkg_imprimir_comprobante.php to validate IDRESERVA parameter using regex: /^[a-zA-Z0-9]+$/

Output Encoding

all

Apply proper HTML encoding to all user-controlled output

Use htmlspecialchars() or equivalent function when outputting IDRESERVA parameter in PHP

🧯 If You Can't Patch

  • Implement WAF rules to block requests containing script tags or JavaScript in IDRESERVA parameter
  • Restrict access to /bkg_imprimir_comprobante.php endpoint to authenticated users only

🔍 How to Verify

Check if Vulnerable:

Test by accessing: http://[target]/bkg_imprimir_comprobante.php?IDRESERVA=<script>alert('XSS')</script> and check if script executes

Check Version:

Check Bookgy version in admin panel or configuration files

Verify Fix Applied:

Retest with same payload - script should not execute and should be properly encoded in output

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests to /bkg_imprimir_comprobante.php with script tags or JavaScript in query parameters
  • Unusual length or character patterns in IDRESERVA parameter

Network Indicators:

  • URLs containing script tags or JavaScript code in query strings
  • Requests to vulnerable endpoint from suspicious sources

SIEM Query:

source="web_logs" AND uri="/bkg_imprimir_comprobante.php" AND (query CONTAINS "<script>" OR query CONTAINS "javascript:")

🔗 References

📤 Share & Export