CVE-2024-34710
📋 TL;DR
Wiki.js versions before 2.5.303 contain a client-side template injection vulnerability that allows attackers to inject malicious JavaScript into page content. When a victim loads a compromised page, the injected code executes in their browser, potentially leading to session hijacking, data theft, or other client-side attacks. All Wiki.js instances running vulnerable versions are affected.
💻 Affected Systems
- Wiki.js
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal user sessions, perform actions as authenticated users, exfiltrate sensitive data from user browsers, or redirect users to malicious sites.
Likely Case
Attackers inject malicious scripts to steal session cookies or authentication tokens, compromising user accounts and potentially gaining unauthorized access to the wiki.
If Mitigated
With proper input validation and output encoding, the injection would be prevented, limiting impact to minor content manipulation.
🎯 Exploit Status
Exploitation requires content editing access. The vulnerability is straightforward to exploit once an attacker can inject content.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.5.303
Vendor Advisory: https://github.com/requarks/wiki/security/advisories/GHSA-xjcj-p2qv-q3rf
Restart Required: Yes
Instructions:
1. Backup your Wiki.js instance. 2. Update to version 2.5.303 or later via the admin panel or by pulling the latest Docker image. 3. Restart the Wiki.js service.
🔧 Temporary Workarounds
Disable content editing for untrusted users
allRestrict content editing permissions to trusted users only to prevent injection.
Implement Content Security Policy (CSP)
allAdd a strict CSP header to limit script execution sources and mitigate impact of successful injections.
Add 'Content-Security-Policy' header with appropriate directives
🧯 If You Can't Patch
- Implement strict input validation and output encoding for all user-generated content
- Monitor for suspicious content edits and implement approval workflows for content changes
🔍 How to Verify
Check if Vulnerable:
Check the Wiki.js version in the admin panel or via the API endpoint /api/version. If version is below 2.5.303, the instance is vulnerable.
Check Version:
curl -s http://your-wiki-domain/api/version | grep version
Verify Fix Applied:
After updating, verify the version is 2.5.303 or higher. Test content editing functionality to ensure it still works properly.
📡 Detection & Monitoring
Log Indicators:
- Unusual content edits, especially with HTML/JavaScript patterns
- Multiple failed login attempts followed by content edits
Network Indicators:
- Outbound connections to suspicious domains from wiki pages
- Unusual JavaScript loading patterns
SIEM Query:
source="wiki-js" AND (event="content_edit" AND (content CONTAINS "<script>" OR content CONTAINS "javascript:"))
🔗 References
- https://github.com/requarks/wiki/commit/1238d614e1599fefadd4614ee4b5797a087f50ac
- https://github.com/requarks/wiki/security/advisories/GHSA-xjcj-p2qv-q3rf
- https://github.com/requarks/wiki/commit/1238d614e1599fefadd4614ee4b5797a087f50ac
- https://github.com/requarks/wiki/security/advisories/GHSA-xjcj-p2qv-q3rf