Secure Computing SnapGear Management Console SG560 v3.1.5 Arbitrary File Read/Write

Title: Secure Computing SnapGear Management Console SG560 v3.1.5 Arbitrary File Read/Write
Advisory ID: ZSL-2020-5568
Type: Local/Remote
Impact: Cross-Site Scripting, Manipulation of data, Exposure of system information, Exposure of sensitive information
Risk: (4/5)
Release Date: 04.06.2020
Summary
The SG gateway appliance range provides Internet security and privacy of communications for small and medium enterprises, and branch offices. It simply and securely connects your office to the Internet, and with its robust stateful firewall, shields your computers from external threats.
Description
The application allows the currently logged-in user to edit the configuration files in the system using the CGI executable 'edit_config_files' in /cgi-bin/cgix/. The files that are allowed to be modified (read/write/delete) are located in the /etc/config/ directory. An attacker can manipulate the POST request parameters to escape from the restricted environment by using absolute path and start reading, writing and deleting arbitrary files on the system.
Vendor
Secure Computing Corp. - http://www.securecomputing.com
Affected Version
3.1.5u1
Tested On
fnord/1.9
Apache 1.3.27 (Unix)
Linux 2.4.31
Vendor Status
N/A
PoC
sg560_rw.txt
Credits
Vulnerability discovered by Gjoko Krstic - <gjoko@zeroscience.mk>
References
[1] https://www.exploit-db.com/exploits/48556
[2] https://packetstormsecurity.com/files/157939
[3] https://exchange.xforce.ibmcloud.com/vulnerabilities/182960
Changelog
[04.06.2020] - Initial release
[05.06.2020] - Added reference [1], [2] and [3]
Contact
Zero Science Lab

Web: https://www.zeroscience.mk
e-mail: lab@zeroscience.mk