/

CVE-2026-116207

Severity:

CRITICAL RISK

(9.1)

SQL Injection (CWE-89) in YesWiki Search API Endpoint

CVE-2026-116207

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Denial of Service

Severity:

CRITICAL RISK

(9.1)

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

YesWiki contains an unauthenticated SQL injection vulnerability in the public Bazar entries search API. An attacker may manipulate search-related field parameters to alter database queries, disclose sensitive records such as password hashes, or consume database resources when the vulnerable search path is reachable.

YesWiki contains an unauthenticated SQL injection vulnerability in the public Bazar entries search API. An attacker may manipulate search-related field parameters to alter database queries, disclose sensitive records such as password hashes, or consume database resources when the vulnerable search path is reachable.

Affected context

The issue occurs in YesWiki deployments using the affected Bazar entries search functionality. Field names derived from the query and searchfields parameters are incorporated into backtick-quoted SQL aliases with escaping that does not safely constrain SQL syntax, creating risk when the public search API accepts attacker-controlled input.

The issue occurs in YesWiki deployments using the affected Bazar entries search functionality. Field names derived from the query and searchfields parameters are incorporated into backtick-quoted SQL aliases with escaping that does not safely constrain SQL syntax, creating risk when the public search API accepts attacker-controlled input.

Exploit preconditions

  • Attack surface: Public Bazar entries search API
  • Required access: No authentication may be required when the endpoint is exposed
  • Trigger point: Processing of attacker-controlled query or searchfields parameters by SearchManager::prepareSearchRequest()
  • Why exploitation is possible: User-supplied field names are inserted into SQL query construction without context-appropriate identifier handling, allowing database expressions to influence query behavior
  • Attack surface: Public Bazar entries search API
  • Required access: No authentication may be required when the endpoint is exposed
  • Trigger point: Processing of attacker-controlled query or searchfields parameters by SearchManager::prepareSearchRequest()
  • Why exploitation is possible: User-supplied field names are inserted into SQL query construction without context-appropriate identifier handling, allowing database expressions to influence query behavior

Why this happens

The vulnerability results from treating attacker-controlled field names as safely escaped SQL identifiers when constructing a database query. Applying string escaping designed for values does not reliably protect identifier or expression contexts, particularly when delimiter characters remain meaningful to the SQL parser. This insecure query-construction pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The vulnerability results from treating attacker-controlled field names as safely escaped SQL identifiers when constructing a database query. Applying string escaping designed for values does not reliably protect identifier or expression contexts, particularly when delimiter characters remain meaningful to the SQL parser. This insecure query-construction pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • Sensitive database records, including user password hashes, may be disclosed
  • Unauthorized SQL expressions may alter the behavior of search queries
  • Database threads and other resources could be exhausted
  • The application may experience degraded availability or denial of service
  • Exposed database information could support follow-on attacks
  • Sensitive database records, including user password hashes, may be disclosed
  • Unauthorized SQL expressions may alter the behavior of search queries
  • Database threads and other resources could be exhausted
  • The application may experience degraded availability or denial of service
  • Exposed database information could support follow-on attacks

General mitigation guidance

Mitigation generally focuses on ensuring that user input cannot define SQL identifiers or expressions.

Common defensive patterns include:

  • Restricting searchable fields to a server-side allowlist of known identifiers
  • Separating validated identifiers from user-supplied query values
  • Using parameterized queries for data values and safe query-builder abstractions where applicable
  • Rejecting unexpected delimiters, operators, and structural input before query construction
  • Applying least-privilege permissions to the database account used by YesWiki
  • Limiting database exposure and adding resource controls to reduce query-based exhaustion

Mitigation generally focuses on ensuring that user input cannot define SQL identifiers or expressions.

Common defensive patterns include:

  • Restricting searchable fields to a server-side allowlist of known identifiers
  • Separating validated identifiers from user-supplied query values
  • Using parameterized queries for data values and safe query-builder abstractions where applicable
  • Rejecting unexpected delimiters, operators, and structural input before query construction
  • Applying least-privilege permissions to the database account used by YesWiki
  • Limiting database exposure and adding resource controls to reduce query-based exhaustion

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis rules identifying string concatenation or interpolation in SQL construction
  • Code review checks for user-controlled identifiers, aliases, and clauses
  • Tests that exercise public search parameters with unexpected structural characters
  • Web application firewall or API policy rules monitoring anomalous search requests
  • Database logging and monitoring for unusual query shapes, metadata access, or long-running sleep-like behavior

Automated security review tools may help identify unsafe query-building patterns, but findings should be validated against the database abstraction and input-validation logic.

Organizations can look for this issue through:

  • Static analysis rules identifying string concatenation or interpolation in SQL construction
  • Code review checks for user-controlled identifiers, aliases, and clauses
  • Tests that exercise public search parameters with unexpected structural characters
  • Web application firewall or API policy rules monitoring anomalous search requests
  • Database logging and monitoring for unusual query shapes, metadata access, or long-running sleep-like behavior

Automated security review tools may help identify unsafe query-building patterns, but findings should be validated against the database abstraction and input-validation logic.

Sources

SourceLink
github.comgithub.com/YesWiki/yeswiki/security/advisories/GHSA-ccp2-6q93-hggh
github.comgithub.com/YesWiki/yeswiki/security/advisories/GHSA-hgxv-w4r8-8877
vulncheck.comvulncheck.com/advisories/yeswiki-4.6.0-before-4.7.0-sql-injection-via-bazar-entries-search-api

Frequently asked

questions

Yes, exploitation may be possible remotely when the public Bazar entries search API is reachable and accepts the affected parameters without authentication.

The described attack path does not require a valid account. Network access to an exposed vulnerable search endpoint is the principal prerequisite.

Ensure that field names come only from a strict server-side allowlist, use context-appropriate query construction, and parameterize all user-controlled data values.

Combine secure database APIs with code review, static analysis, input-focused testing, least-privilege database accounts, and monitoring for anomalous query activity.

Yes, exploitation may be possible remotely when the public Bazar entries search API is reachable and accepts the affected parameters without authentication.

The described attack path does not require a valid account. Network access to an exposed vulnerable search endpoint is the principal prerequisite.

Ensure that field names come only from a strict server-side allowlist, use context-appropriate query construction, and parameterize all user-controlled data values.

Combine secure database APIs with code review, static analysis, input-focused testing, least-privilege database accounts, and monitoring for anomalous query activity.

Find out what's already
exploitable in your codebase.