CVE-2021-4017

8.8 HIGH

📋 TL;DR

CVE-2021-4017 is a Cross-Site Request Forgery (CSRF) vulnerability in showdoc, a documentation tool. It allows attackers to trick authenticated users into performing unintended actions like modifying documentation or changing settings. All showdoc installations with authenticated users are affected.

💻 Affected Systems

Products:
  • showdoc
Versions: All versions before commit 654e871a3923e79076818a9a03533fe88222c871
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations are vulnerable. The vulnerability affects the web interface when users are authenticated.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could modify or delete all documentation, change administrative settings, or potentially compromise the entire showdoc instance if combined with other vulnerabilities.

🟠

Likely Case

Unauthorized modifications to documentation content, user permissions changes, or configuration alterations leading to data integrity issues.

🟢

If Mitigated

Minimal impact if proper CSRF protections are implemented and users follow security best practices.

🌐 Internet-Facing: HIGH - Internet-facing showdoc instances are directly accessible to attackers who can craft malicious requests.
🏢 Internal Only: MEDIUM - Internal instances are still vulnerable to attacks from compromised internal systems or malicious insiders.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires the victim to be authenticated and visit a malicious page. CSRF attacks are well-understood and easy to implement.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Commit 654e871a3923e79076818a9a03533fe88222c871 or later

Vendor Advisory: https://github.com/star7th/showdoc/commit/654e871a3923e79076818a9a03533fe88222c871

Restart Required: No

Instructions:

1. Update showdoc to the latest version. 2. Apply commit 654e871a3923e79076818a9a03533fe88222c871. 3. Verify CSRF tokens are properly implemented in all forms.

🔧 Temporary Workarounds

Implement CSRF Protection Manually

all

Add CSRF tokens to all forms and validate them server-side.

Modify showdoc source code to include CSRF tokens in forms and validate them in corresponding endpoints.

Use SameSite Cookies

all

Configure session cookies with SameSite=Strict attribute to prevent CSRF attacks.

Set session cookie with 'SameSite=Strict' in your web server configuration or application code.

🧯 If You Can't Patch

  • Implement a web application firewall (WAF) with CSRF protection rules
  • Restrict showdoc access to trusted networks only and monitor for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Check if your showdoc version is older than commit 654e871a3923e79076818a9a03533fe88222c871 by examining the source code or version metadata.

Check Version:

Check the showdoc version in the web interface or examine the source code for the commit hash.

Verify Fix Applied:

Verify that CSRF tokens are present in all forms and validated server-side. Test with a CSRF proof-of-concept to confirm protection.

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed form submissions without CSRF tokens
  • Unusual documentation modifications from unexpected IP addresses

Network Indicators:

  • HTTP requests to showdoc endpoints without proper referer headers or CSRF tokens from external sources

SIEM Query:

source="showdoc_logs" AND (event="form_submission" AND csrf_token="missing" OR event="unauthorized_modification")

🔗 References

📤 Share & Export