CVE-2024-42902

8.8 HIGH

📋 TL;DR

This vulnerability allows attackers to execute arbitrary code on LimeSurvey servers by injecting malicious payloads into the lng parameter of the js_localize.php function. It affects LimeSurvey installations up to version 6.6.2. Attackers can potentially take full control of affected systems.

💻 Affected Systems

Products:
  • LimeSurvey
Versions: v6.6.2 and earlier versions
Operating Systems: All operating systems running LimeSurvey
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerable js_localize.php file is part of the kcfinder component included with LimeSurvey.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise leading to data theft, lateral movement, ransomware deployment, or persistent backdoor installation.

🟠

Likely Case

Remote code execution allowing attackers to deface websites, steal survey data, or use the server for malicious activities.

🟢

If Mitigated

Limited impact with proper network segmentation, WAF rules, and minimal privileges.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is typically accessible from the internet without authentication.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this if they have network access to the LimeSurvey instance.

🎯 Exploit Status

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

Exploit code is publicly available in GitHub repositories. The vulnerability requires no authentication and has simple exploitation steps.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v6.6.3 or later

Vendor Advisory: https://bugs.limesurvey.org/view.php?id=19639

Restart Required: No

Instructions:

1. Backup your LimeSurvey installation and database. 2. Download the latest version from the official LimeSurvey website. 3. Replace the vulnerable js_localize.php file or upgrade the entire installation. 4. Verify the fix by checking the version number.

🔧 Temporary Workarounds

Remove vulnerable file

linux

Delete or rename the vulnerable js_localize.php file to prevent exploitation

rm /path/to/limesurvey/vendor/kcfinder/js_localize.php

Restrict access via web server

all

Block access to the vulnerable endpoint using web server configuration

# Apache: <Location "/vendor/kcfinder/js_localize.php">
    Require all denied
</Location>
# Nginx: location ~ /vendor/kcfinder/js_localize\.php$ { deny all; }

🧯 If You Can't Patch

  • Implement strict network access controls to limit who can reach the LimeSurvey instance
  • Deploy a web application firewall (WAF) with rules to block malicious lng parameter values

🔍 How to Verify

Check if Vulnerable:

Check if the file /vendor/kcfinder/js_localize.php exists in your LimeSurvey installation and examine its contents for the vulnerable code pattern.

Check Version:

Check the version.txt file in your LimeSurvey root directory or view the admin panel version information.

Verify Fix Applied:

Verify that the js_localize.php file has been updated or removed, and confirm your LimeSurvey version is 6.6.3 or higher.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST/GET requests to js_localize.php with long or encoded lng parameters
  • Web server error logs showing PHP execution errors from the kcfinder directory
  • System logs showing unexpected process execution from the web server user

Network Indicators:

  • HTTP requests to /vendor/kcfinder/js_localize.php with suspicious lng parameter values
  • Outbound connections from the LimeSurvey server to unknown IPs

SIEM Query:

source="web_server_logs" AND (uri="/vendor/kcfinder/js_localize.php" OR uri="/js_localize.php") AND (param="lng" AND length(value)>100)

🔗 References

📤 Share & Export