CVE-2017-6396

6.1 MEDIUM

📋 TL;DR

CVE-2017-6396 is a cross-site scripting (XSS) vulnerability in WebPageTest 3.0 that allows attackers to inject malicious HTML and scripts via the compare-cf.php endpoint. This affects any organization running the vulnerable WebPageTest version, potentially compromising user sessions and website integrity.

💻 Affected Systems

Products:
  • WPO-Foundation WebPageTest
Versions: Version 3.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects the specific compare-cf.php endpoint in WebPageTest 3.0 installations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could steal session cookies, perform actions as authenticated users, deface websites, or redirect users to malicious sites, leading to full account compromise and data theft.

🟠

Likely Case

Session hijacking, credential theft, or website defacement through injected malicious scripts that execute in users' browsers.

🟢

If Mitigated

Limited impact with proper input validation, output encoding, and Content Security Policy (CSP) headers preventing script execution.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires user interaction (visiting malicious link) but is straightforward with public proof-of-concept available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after 3.0

Vendor Advisory: https://github.com/WPO-Foundation/webpagetest/issues/820

Restart Required: No

Instructions:

1. Upgrade WebPageTest to latest version. 2. Apply input validation and output encoding fixes from GitHub issue #820. 3. Test the compare-cf.php endpoint for XSS vulnerabilities.

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side input validation to sanitize user-supplied data before processing in compare-cf.php

# Modify webpagetest-master/www/compare-cf.php to filter user inputs
# Example: htmlspecialchars($_GET['parameter'], ENT_QUOTES, 'UTF-8')

Content Security Policy

all

Implement CSP headers to restrict script execution sources

# Add to web server config or PHP header: Content-Security-Policy: default-src 'self'

🧯 If You Can't Patch

  • Disable or restrict access to the compare-cf.php endpoint via web server configuration
  • Implement web application firewall (WAF) rules to block XSS payloads targeting the vulnerable endpoint

🔍 How to Verify

Check if Vulnerable:

Test the compare-cf.php endpoint with XSS payloads like <script>alert('XSS')</script> in user-supplied parameters

Check Version:

Check WebPageTest version in configuration files or via web interface

Verify Fix Applied:

Verify that script tags and HTML injections are properly sanitized or escaped in the compare-cf.php output

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST/GET requests to compare-cf.php with script tags or encoded payloads
  • Multiple failed validation attempts on the vulnerable endpoint

Network Indicators:

  • HTTP requests containing <script> tags or javascript: URIs targeting compare-cf.php

SIEM Query:

source="web_server" AND uri="*compare-cf.php*" AND (content="*<script>*" OR content="*javascript:*")

🔗 References

📤 Share & Export