TestLink Open Source Test Management(<= 1.9.16) Remote Code Execution By Manish (error1046)
Testlink (Version Below 1.9.17) is vulnerable to Remote Code Execution. Vulnerable code is in file 'install/installNewDB.php'. Testlink allows user to re-install it and when user visits '/install/' directory and reachs to 'Database detail' page i.e 'install/installNewDB.php', user can specifiy PHP code in 'TestLink DB login' field. After successful installation, PHP code will get save in config file. During installation process, script first try to connect MySQL 'root' user account (supplied by user during installation phase), if script is able to connect to MySQL server (locally or remotly hosted), process of CMS installation goes further. Script save MySQL server host, username and password in config file. Here attacker can take advantage of this process to write PHP code in config file. To do this, attacker need to setup MySQL server on a machine and MySQL server must be configure to accept connection from remote IP (which can be done easily by changing parameter in my.cnf file). To configure MySQL server open to remote connection, just open my.cnf file and comment out skip-networking as well as bind-address (if any present in my.cnf )i.e change line 'skip-networking' to '# skip-networking' and 'bind-address = some_ip' to '#bind-address = some_ip' save the my.cnf file. reload/restart MySQL server and your mysql server will accept remote connection from any remote IP Now, you need to configure MySQL root user in such way so that when remote script try to connect to MySQL server root user, it allows remote script. When attacker provide credentials of a Remote MySQL server which is attacker controlled and listening for remote connection, attacker just need to specifiy PHP code in 'TestLink DB login' field.