Issues (280)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

config/default.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php exit;
2
3
//Check everything exists before using it
4
if(!isset($_SERVER['HTTP_ACCEPT_ENCODING']))
5
	$_SERVER['HTTP_ACCEPT_ENCODING'] = '';
6
if(!isset($_SERVER['HTTP_USER_AGENT']))
7
	$_SERVER['HTTP_USER_AGENT'] = '';
8
9
// Determine supported compression method
10
$gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
11
$deflate = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate');
12
13
// Determine used compression method
14
$encoding = $gzip ? 'gzip' : ($deflate ? 'deflate' : 'none');
15
16
// Check for buggy versions of Internet Explorer
17
if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') &&
18
	preg_match('/^Mozilla\/4\.0 \(compatible; MSIE ([0-9]\.[0-9])/i', $_SERVER['HTTP_USER_AGENT'], $matches))
19
{
20
	$version = floatval($matches[1]);
21
22
	if ($version < 6)
23
		$encoding = 'none';
24
25
	if ($version == 6 && !strstr($_SERVER['HTTP_USER_AGENT'], 'EV1'))
26
		$encoding = 'none';
27
}
28
29
//Some servers compress the output of PHP - Don't break in those cases
30
if(ini_get('output_handler') == 'ob_gzhandler' || ini_get('zlib.output_compression') == 1)
31
	$encoding = 'none';
32
33
$iscompressed = file_exists(__FILE__.'.'.$encoding);
34
if($encoding != 'none' && $iscompressed == false)
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison === instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
35
{
36
	$flag = ($encoding == 'gzip' ? FORCE_GZIP : FORCE_DEFLATE);
37
	$code = file_get_contents(__FILE__.'.none');
38
	$contents = gzencode($code,9,$flag);
39
}else{
40
	//Get data
41
	$contents = file_get_contents(__FILE__.'.'.$encoding);
42
}
43
44
// first check if we have to send 304
45
// inspired by http://www.jonasjohn.de/snippets/php/caching.htm
46
47
$eTag=md5($contents);
48
$modTime=filemtime(__FILE__.'.none');
49
50
date_default_timezone_set("UTC");
51
$eTagMatch = (isset($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'],$eTag));
52
$modTimeMatch = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) === $modTime);
53
54
if (($modTimeMatch)||($eTagMatch)) {
55
	header('HTTP/1.1 304 Not Modified');
56
	header('Connection: close');
57
} else {
58
	// send all sorts of headers
59
	$expireTime=60*60*24*355; // 1y max according to RFC
60
	if ($encoding != 'none') {
61
		header('Content-Encoding: '.$encoding);
62
	}
63
	header('Vary: Accept-Encoding');
64
	header('Content-Length: '.strlen($contents));
65
	header('Content-type: %%CONTENT%%; charset=utf-8');
66
	header('Cache-Control: max-age='.$expireTime.', public, must-revalidate');
67
	header('Cache-Control: max-age='.$expireTime.', public, immutable');
68
	header('Expires: '.gmdate('D, d M Y H:i:s', time() + $expireTime).' GMT');
69
	header('ETag: ' . $eTag);
70
	header('Last-Modified: '.gmdate('D, d M Y H:i:s', $modTime).' GMT');
71
72
	// send output
73
	echo $contents;
74
75
	//And write to filesystem cache if not done yet
76
	if($encoding != 'none' && $iscompressed == false)
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison === instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
77
	{
78
		//Write the content we sent
79
		file_put_contents(__FILE__.'.'.$encoding,$contents);
80
81
		//And write the new content
82
		$flag = ($encoding == 'gzip' ? FORCE_DEFLATE : FORCE_GZIP);
83
		$ext = ($encoding == 'gzip' ? 'deflate' : 'gzip');
84
		$contents = gzencode($code,9,$flag);
85
		file_put_contents(__FILE__.'.'.$ext,$contents);
86
	}
87
}
88