YesWiki Unauthenticated SQL Injection Vulnerability
YesWiki versions prior to 4.6.4 are vulnerable to an unauthenticated SQL injection in the Bazar form-import path (`FormManager::create()`), allowing an unauthenticated attacker to inject arbitrary SQL into an `INSERT` statement and read the full database, including `yeswiki_users.password` hashes (CVE-2026-46670).
YesWiki is susceptible to an unauthenticated SQL injection vulnerability within the Bazar form-import functionality, specifically affecting versions prior to 4.6.4. The vulnerability resides in the FormManager::create() function, where unsanitized input is concatenated into an SQL INSERT statement. This allows any unauthenticated visitor to inject arbitrary SQL code and potentially extract sensitive information, including user credentials, from the database. The issue was identified and analyzed against commit 1f485c049db030b94c047ec219e63534ac81142e. Exploitation is straightforward, requiring only a crafted HTTP POST request, making this a critical vulnerability for any publicly accessible YesWiki instance.
Attack Chain
- An unauthenticated attacker sends a crafted HTTP POST request to the
/?BazaR&vue=formulaireendpoint. - The request contains a specially crafted
imported-formparameter with SQL injection payload. - The
FormManager::create()function (FormManager.php#L258) processes the request and concatenates the malicious input into an SQL INSERT statement without proper sanitization. - The injected SQL code executes within the context of the YesWiki database.
- The attacker uses the SQL injection to extract data from the
yeswiki_userstable, including email addresses and password hashes. - The extracted data is encoded and embedded within the
bn_id_naturefield of a newly created database entry. - The attacker then sends a request to
/?api/formsto retrieve thebn_id_naturefield. - The attacker decodes the extracted data to obtain sensitive information, such as usernames, emails, and password hashes.
Impact
Successful exploitation of this vulnerability (CVE-2026-46670) allows an unauthenticated attacker to dump the entire YesWiki database. This includes sensitive information such as usernames, email addresses, and, most critically, hashed passwords of all users. This complete data breach can lead to account compromise, unauthorized access to sensitive wiki content, and potential lateral movement within the organization if users reuse passwords across multiple services. The impact is particularly severe given the ease of exploitation.
Recommendation
- Upgrade YesWiki to version 4.6.4 or later to patch the SQL injection vulnerability in
FormManager::create()(reference: GHSA-jwvv-qr7q-cv8j). - Deploy the Sigma rule “Detect YesWiki Unauthenticated SQL Injection Attempt” to detect exploitation attempts against the vulnerable endpoint.
- Monitor web server logs for POST requests to
/?BazaR&vue=formulairewith suspicious characters in theimported-formparameter (reference: sample HTTP request in the content). - Apply the Sigma rule “Detect YesWiki Data Exfiltration via API” to detect attempts to retrieve encoded data using the
/?api/formsendpoint after successful SQL injection.
Detection coverage 2
Detect YesWiki Unauthenticated SQL Injection Attempt
highDetects CVE-2026-46670 exploitation — detects HTTP POST requests to the Bazar form import endpoint with potential SQL injection attempts in the imported-form parameter.
Detect YesWiki Data Exfiltration via API
mediumDetects encoded data retrieval from /?api/forms, potentially indicating successful SQL injection and data exfiltration.
Detection queries are available on the platform. Get full rules →