`During a security assessment, Ive found that my target was using Cryptographp which is a PHP script used for generate « captchas ».
It was easily noticeable when Ive found the following URL:
http://WWWW/cryptographp.inc.php?cfg=XX&sn=YYYY&ZZZZ
So I've decided to take a look at the source code and Ive found 2 vulnerabilities.
The first one has already been disclosed but hasnt been corrected. This vulnerability allows an attacker to execute arbitrary scripts on the host server by causing cryptographp.inc.php to include any arbitrary file existent in the same directory.
Here is the vulnerable source code:
if (is_file($_GET['cfg']) and dirname($_GET['cfg'])=='.' )
$_SESSION['configfile']=$_GET['cfg'];
else
$_SESSION['configfile']="cryptographp.cfg.php";
include($_SESSION['configfile']);
The second vulnerability can be easily found but seems not to be revealed on Internet or on an exploit database. It is an HTTP Response Splitting which can be used to perform cross-site scripting attacks, cross-user defacement, web cache poisoning, and similar exploits.
Here is the vulnerable source code:
<?php
Header("Location: cryptographp.inc.php?cfg=".$_GET['cfg']."&sn=".session_name()."&".SID);
?>
For the mitigation of this two vulnerabilities, one simple rule:
Input Validation
Lu33Y -
`
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation