/

CVE-2026-41143

Severity:

HIGH RISK

(8.8)

SQL Injection in YesWiki Bazar EntryManager Module

CVE-2026-41143

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Manipulation

Severity:

HIGH RISK

(8.8)

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 YesWiki Bazar module allows user-controlled data from $_POST['id_fiche'] to be concatenated directly into a raw SQL query without sanitization or parameterization.

Under typical deployments where attackers can submit or modify id_fiche values, this flaw can enable unauthorized database access, data exfiltration, or manipulation through crafted input.

Affected context

This vulnerability occurs within the YesWiki Bazar module's EntryManager functionality, where incoming POST requests carry an id_fiche parameter.

The issue is present when:

  • The application accepts id_fiche via HTTP POST (e.g., form submissions or AJAX calls),
  • The value is passed to EntryManager.php and concatenated into a SQL query at line 704,
  • No database abstraction with prepared statements or centralized input validation is enforced for this field.

Any deployment that exposes the Bazar module to untrusted users may be affected.

Exploit preconditions

  • Attack surface: Web-facing endpoints that invoke the Bazar EntryManager and process $_POST['id_fiche'].
  • Required access: Ability to send POST requests to the vulnerable endpoint (often anonymous or low-privileged user access is sufficient).
  • Trigger point: Submission of a specially crafted id_fiche value that alters the structure of the SQL query.
  • Why exploitation is possible: The application embeds $_POST['id_fiche'] directly into a SQL statement without parameter binding or escaping, allowing user input to be interpreted as SQL syntax instead of data.

Why this happens

The root cause is the direct concatenation of user-supplied data into a SQL query string, a classic case of CWE-89: SQL Injection.

Instead of treating id_fiche purely as data using prepared statements or query parameterization, the value is inserted into the query text, letting attackers inject additional SQL fragments.

This insecure pattern arises when application logic builds SQL dynamically in PHP without using database APIs that separate query structure from user input.

Potential impact

  • Unauthorized reading of database records that the application would not normally expose
  • Modification or deletion of application data, including wiki content and associated metadata
  • Bypassing of application-level authorization checks enforced in the database layer
  • Potential creation of new privileged application accounts or manipulation of existing ones
  • In some configurations, possible execution of additional database-level commands that impact availability or integrity

General mitigation guidance

Effective mitigation focuses on eliminating dynamic SQL that mixes user input with query syntax and reducing trust in incoming parameters.

Common defensive patterns include:

  • Using prepared statements with bound parameters for all queries, especially those involving request data such as $_POST['id_fiche'].
  • Centralizing database access through a data access layer that enforces parameterization by default, rather than allowing raw query construction.
  • Applying strict server-side validation and type enforcement for identifiers (e.g., ensuring id_fiche is treated as an integer or a constrained token).
  • Limiting database privileges of the application user so that injected queries have minimal impact, following least-privilege principles.
  • Designing queries and schemas to avoid exposing unnecessary tables or sensitive fields to the application account.

How teams detect issues like this

Organizations can detect this kind of SQL injection risk using a combination of code-centric and behavior-centric approaches:

  • Static analysis: Configure SAST tools or linters to flag string concatenation involving $_POST, $_GET, and similar superglobals in SQL query construction, especially around the Bazar module.
  • Code review: Look for raw query building functions (e.g., $db->query("...$variable...")) and verify that all user input is passed through prepared statements or parameter binding APIs.
  • Policy enforcement: Establish coding policies that prohibit ad-hoc SQL construction and require ORM or parameterized query helpers for all database interactions.
  • Runtime monitoring: Use web application firewalls or database activity monitoring solutions to detect anomalous SQL patterns and potential injection attempts in production logs.

Sources

SourceLink
github.comgithub.com/YesWiki/yeswiki/releases/tag/v4.6.1
github.comgithub.com/YesWiki/yeswiki/security/advisories/GHSA-f58v-p6j9-24c2

Frequently asked

questions

Yes. If the affected Bazar module endpoint is accessible over the network and accepts POST requests from untrusted users, an attacker can exploit the injection remotely by sending crafted id_fiche values.

Typically, only the ability to submit or modify the id_fiche parameter is required, which may be available to anonymous or low-privileged users depending on how the wiki is configured and exposed.

The safest approach is to replace all dynamic SQL that embeds id_fiche with parameterized queries or prepared statements, coupled with strict type validation so that the database only ever receives id_fiche as data, not as query text.

Prevention relies on adopting a consistent secure data access strategy: use parameterized queries by default, validate and normalize all external input, enforce least privilege at the database level, and integrate static analysis and security-focused code review into the development workflow.

Find out what's already
exploitable in your codebase.