CVE-2023-49277

8.3 HIGH

📋 TL;DR

This vulnerability in dpaste allows attackers to execute arbitrary JavaScript in users' browsers via a reflected XSS attack through the expires parameter in the API. It affects all dpaste installations running versions older than v3.8. Successful exploitation could lead to session hijacking, data theft, or unauthorized actions.

💻 Affected Systems

Products:
  • dpaste
Versions: All versions < v3.8
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All dpaste installations using the default configuration are vulnerable if running affected versions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attacker steals admin session cookies, takes over the dpaste instance, accesses all pasted data, and potentially compromises the underlying server.

🟠

Likely Case

Attacker steals user session cookies to access private pastes or performs phishing attacks by injecting malicious content.

🟢

If Mitigated

With proper CSP headers and input validation, impact is limited to temporary UI disruption.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Reflected XSS vulnerabilities are commonly weaponized. No public PoC found but exploitation is straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v3.8

Vendor Advisory: https://github.com/DarrenOfficial/dpaste/security/advisories/GHSA-r8j9-5cj7-cv39

Restart Required: Yes

Instructions:

1. Backup your dpaste data and configuration. 2. Stop the dpaste service. 3. Update dpaste to v3.8 or later using pip: 'pip install --upgrade dpaste'. 4. Restart the dpaste service.

🧯 If You Can't Patch

  • Implement a Web Application Firewall (WAF) with XSS protection rules.
  • Add Content Security Policy (CSP) headers to restrict script execution.

🔍 How to Verify

Check if Vulnerable:

Check dpaste version: 'dpaste --version' or examine package metadata. If version is below 3.8, it's vulnerable.

Check Version:

dpaste --version

Verify Fix Applied:

Confirm version is 3.8 or higher: 'dpaste --version' should show 3.8+. Test API endpoints with XSS payloads in expires parameter to ensure they're sanitized.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to API endpoints with JavaScript in expires parameter
  • Multiple failed XSS attempts in access logs

Network Indicators:

  • HTTP requests containing script tags or JavaScript in expires parameter
  • Unusual outbound connections after API calls

SIEM Query:

source="dpaste_logs" AND (http_method="POST" AND uri_path="/api/" AND query_string="*expires=*<script*" OR query_string="*expires=*javascript:*")

🔗 References

📤 Share & Export