/

CVE-2026-46670

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in YesWiki Bazar Form Import

CVE-2026-46670

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Credential Exposure

Severity:

CRITICAL RISK

(9.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 critical unauthenticated SQL injection in YesWiki's Bazar form-import path allows arbitrary SQL to be inserted into a database INSERT statement. On affected default installations, an unauthenticated visitor may read database contents, including password hashes stored in the yeswiki_users table.

Affected context

The vulnerability occurs in YesWiki installations that expose the Bazar form-import functionality and process attacker-controlled input through FormManager::create(). It is especially risky when the endpoint is reachable without authentication and the application database account has broad read or write permissions.

Exploit preconditions

  • Attack surface: Publicly reachable YesWiki Bazar form-import functionality
  • Required access: No authentication is generally required on affected default installations
  • Trigger point: Processing of attacker-controlled form-import data by FormManager::create()
  • Why exploitation is possible: Input is incorporated into an SQL INSERT statement without adequate parameterization or equivalent query-safety controls

Why this happens

The underlying bug is an SQL injection flaw, mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Application-controlled SQL statements incorporate untrusted form-import values without reliably separating data from executable query syntax, allowing database commands to be altered by crafted input.

Potential impact

  • An attacker may read sensitive records from the application database
  • Password hashes, including entries in yeswiki_users.password, could be exposed
  • Database records may be modified, inserted, or deleted
  • Application integrity and stored wiki content could be compromised
  • Exposed credentials may enable follow-on account compromise if reused

General mitigation guidance

Mitigation generally focuses on enforcing a strict separation between SQL code and user-supplied data.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for every database operation
  • Validate imported fields against explicit schemas, types, lengths, and allowed values
  • Avoid constructing SQL fragments through string concatenation or interpolation
  • Apply least-privilege permissions to the database account used by YesWiki
  • Restrict public access to form-import functionality when it is not required
  • Store password hashes using appropriate password-hashing controls and limit access to credential tables
  • Add regression tests covering malformed, unexpected, and boundary-value inputs

How teams detect issues like this

Organizations commonly detect SQL injection risks through:

  • Static analysis rules identifying SQL built through concatenation or interpolation
  • Code review checks for direct use of request or form values in database queries
  • Dynamic application testing that submits unexpected delimiters and type-conflicting values
  • Web application firewall or database monitoring policies for suspicious query patterns
  • Database audit logging for unusual reads from user, credential, or metadata tables
  • Automated security review tools integrated into CI pipelines to flag unsafe query construction

Sources

SourceLink
github.comgithub.com/YesWiki/yeswiki/security/advisories/GHSA-jwvv-qr7q-cv8j

Frequently asked

questions

Yes. On affected default installations, the vulnerable form-import path may be reachable by unauthenticated visitors over the network.

The attacker generally needs only network access to the exposed YesWiki functionality; a user account is not typically required.

Replace dynamic SQL construction with parameterized queries, validate imported data against a strict schema, and ensure database permissions are limited.

Review all database calls for separation of code and data, test public input paths, monitor database access, and enforce SQL-injection checks in development and CI workflows.

Find out what's already
exploitable in your codebase.