
CVE-2022-23131 Zabbix Server SAML authentication exploit
This Python script exploits a misconfigured SAML authentication flow on a Zabbix server. By providing a Zabbix server URL and a user (default: Admin), the script generates an authenticated Zabbix session (zbx_session), and attempts to access the dashboard with the authenticated session.
To use the script, run it from the command line and provide the target Zabbix server URL. You can optionally specify a user and a custom user agent.
python cve-2022-23131.py <target_url>
-u or --user: Specify the Zabbix user to authenticate as (default: Admin).-a or --user-agent: Provide a custom User-Agent string.python cve-2022-23131.py https://zabbix.local
python cve-2022-23131.py https://zabbix.local -u JohnDoe
python cve-2022-23131.py https://zabbix.local -u JohnDoe -a "CustomUserAgent/1.0"
The script will indicate whether the exploit was successful. If successful, it will print an authenticated zbx_session, which you can use to access the Zabbix dashboard.
Here’s an example of the script in action:

Once you have successfully retrieved the zbx_session value, you can manually update the cookie in your browser to authenticate yourself as the specified user. Follow the steps below for Chrome or Firefox.
zbx_session cookie.zbx_session value, and press Enter.zbx_session cookie.zbx_session value, and press Enter.Here is an example of how to update the cookie in the Developer Tools:

Credits for this exploit write-up go to @random-robbie, @jweny, and @Mr-xn. I just modified the script as I found it wasn't working as expected anymore.
Reference: https://github.com/Mr-xn/cve-2022-23131