/

CVE-2025-65091

Severity:

CRITICAL RISK

(10.0)

SQL Injection in XWiki Full Calendar Macro JSON Service

CVE-2025-65091

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise and Denial of Service

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection vulnerability in the XWiki Full Calendar Macro's Calendar.JSONService endpoint allows attackers to inject arbitrary SQL into backend queries.

When a user with permission to view this page (including unauthenticated guests in some deployments) interacts with the macro, crafted input can be used to access database information or disrupt service availability.

Affected context

This vulnerability arises in XWiki installations that use the Full Calendar Macro and expose the Calendar.JSONService page.

Any deployment where this page is viewable by broad user groups—especially anonymous or guest users—creates a reachable SQL injection surface.

The issue manifests when user-controllable data is incorporated into SQL queries used to fetch or manipulate calendar-related information in the wiki database.

Exploit preconditions

  • Attack surface: HTTP interface exposing the Full Calendar Macro's Calendar.JSONService endpoint.
  • Required access: Ability to access and view the Calendar.JSONService page; in some configurations, this includes unauthenticated (guest) users.
  • Trigger point: Request parameters or fields that are processed by the JSON service and incorporated into SQL queries.
  • Why exploitation is possible: User-controlled input is embedded into SQL statements without adequate parameterization or sanitization, allowing an attacker to alter the intended query structure.

Why this happens

The root cause is improper construction of SQL queries using data derived from HTTP requests.

Instead of relying on parameterized queries or a safe query-building abstraction, the implementation appears to concatenate or interpolate user input directly into SQL.

This pattern maps directly to CWE-89: SQL Injection, where the application fails to correctly separate data from control instructions, enabling an attacker to influence the semantics of database interactions through crafted inputs.

Potential impact

  • Extraction of sensitive database information (e.g., wiki pages, user-related data, or configuration details), depending on underlying database privileges.
  • Corruption or deletion of calendar-related or broader application data if writable queries are reachable.
  • Denial of service by forcing expensive or malformed queries, potentially locking tables or exhausting database resources.
  • Pivoting to additional attacks if database-level access reveals secrets, configuration parameters, or other data that can be reused elsewhere.

General mitigation guidance

Mitigation generally centers on treating all inbound data to database layers as untrusted and structurally separated from query logic.

Useful defensive patterns include:

  • Using parameterized queries or prepared statements for all database access paths, especially those driven by web requests.
  • Employing higher-level ORM or query-builder abstractions that automatically parameterize values instead of concatenating strings.
  • Implementing strict validation and canonicalization of calendar-related parameters (dates, IDs, filters) to ensure they conform to expected formats and types.
  • Restricting who can access sensitive service endpoints like Calendar.JSONService and applying least-privilege principles so that database accounts only have the minimal rights needed.
  • Adopting secure-by-default coding guidelines that forbid manual string-building of SQL except under carefully reviewed conditions.

How teams detect issues like this

Detection can focus on both code-level patterns and runtime behavior:

  • Static analysis: Configure rules to flag dynamic SQL string construction that incorporates HTTP parameters or other tainted input, highlighting direct concatenation or formatting patterns.
  • Code review: Pay special attention to service endpoints (such as JSON APIs) that transform user-provided filters or search terms into SQL; look for places where validation is weak or absent.
  • Policy enforcement: Enforce development policies that mandate parameterized queries and require security sign-off for any exceptions.
  • Runtime monitoring: Use database and application logging to detect anomalous query patterns (e.g., injected operators, unexpected UNIONs, or tautological conditions) that may indicate SQL injection attempts.
  • Automated SAST/DAST tools can assist by scanning for SQL injection sinks and probing endpoints with crafted payloads to discover unsafe behaviors.

Sources

SourceLink
github.comgithub.com/xwiki-contrib/macro-fullcalendar/commit/5fdcf06a05015786492fda69b4d9dea5460cc994
github.comgithub.com/xwiki-contrib/macro-fullcalendar/security/advisories/GHSA-2g22-wg49-fgv5

Frequently asked

questions

Yes. If the Calendar.JSONService page is exposed to network clients (including the public internet) and accessible to the attacker's account or as a guest, a remote attacker can exploit it via crafted HTTP requests.

The attacker only needs the ability to view or invoke the Calendar.JSONService endpoint.

In some configurations this may require no authentication at all, significantly broadening the attack surface.

The most robust fix pattern is to ensure that all database interactions in the affected code path use parameterized queries or ORM-based abstractions, with no direct string concatenation of user input.

In addition, validate calendar parameters (such as date ranges and identifiers) against strict schemas and apply least-privilege database permissions.

Prevention involves institutionalizing secure coding practices: standardize on parameterized database access layers, enforce input validation for all externally influenced parameters, integrate static and dynamic security testing into the CI pipeline, and include security-focused code reviews for any changes touching database or query-building logic.

Find out what's already
exploitable in your codebase.