Issues (1752)

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.

class/sync-db-curl.test.php (4 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
2
/**
3
 * @package		fwolflib
4
 * @subpackage	class.test
5
 * @copyright	Copyright 2010, Fwolf
6
 * @author		Fwolf <[email protected]>
7
 * @since		2010-05-25
8
 */
9
10
// Usage example
11
12
// Include
13 View Code Duplication
if (0 <= version_compare(phpversion(), '5.3.0')) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
	require_once(__DIR__ . '/sync-db-curl.php');
15
} else {
16
	require_once(dirname(__FILE__) . '/sync-db-curl.php');
17
}
18
19
20
// Global/default config
21
$ar_default = array(
22
	'url'		=> '',
23
	'db_client'	=> array(
24
		'type'	=> 'mysql',
25
		'host'	=> 'localhost',
26
		'user'	=> 'test',
27
		'pass'	=> '',
28
		'name'	=> 't-sync-db-curl1',
29
//		'name'	=> 't-2008-zbb',
30
		'lang'	=> 'utf-8',
31
	),
32
	'db_server'	=> array(
33
		'type'	=> 'mysql',
34
		'host'	=> 'localhost',
35
		'user'	=> 'test',
36
		'pass'	=> '',
37
		'name'	=> 't-sync-db-curl2',
38
		'lang'	=> 'utf-8',
39
	),
40
	'pull'		=> '',
41
	'push'		=> '',
42
);
43
$s_crypt_key = 'blahblahblah';
44
45
46
// Per server config, if any part is missing, use default.
47
// Key is name of server, will be recorded in db log tbl.
48
$ar_server['test server'] = array(
49
	'url'	=> 'http://local.fwolf.com/dev/fwolflib/class/sync-db-curl.test.php',
50
);
51
$ar_server['test server']['db_server'] = array(
52
	'type'	=> 'mysql',
53
	'host'	=> 'localhost',
54
	'user'	=> 'test',
55
	'pass'	=> '',
56
	'name'	=> 't-2008-zbb',
57
	'lang'	=> 'utf-8',
58
);
59
$ar_server['test server']['pull'] = 'ent*, -*cert_hbb_??
60
	-*pm, +re????, -v*';
61
$ar_server['test server2'] = array(
62
	'url'	=> 'http://local.fwolf.com/dev/fwolflib/class/sync-db-curl.test.php',
63
);
64
65
66
if (empty($_POST)) {
67
	// Act as client
68
69
	// Avoid duplicate run at client side.
70
	$f_lock = sys_get_temp_dir() . '/sync-db-curl.test.lock';
71
	if (file_exists($f_lock)) {
72
		// Already running
73
		Ecl('Previous run not end or clean.');
0 ignored issues
show
Deprecated Code introduced by
The function Ecl() has been deprecated with message: Use Fwlib\Util\Env::ecl()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
74
		Ecl('Lock file: ' . $f_lock);
0 ignored issues
show
Deprecated Code introduced by
The function Ecl() has been deprecated with message: Use Fwlib\Util\Env::ecl()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
75
		die();
76
	}
77
	file_put_contents($f_lock, '');
78
79
	$ar_cfg = array(
80
		'crypt_key'		=> $s_crypt_key,
81
		'default'		=> $ar_default,
82
		'server'		=> $ar_server,
83
	);
84
	$o_sdc = new SyncDbCurl($ar_cfg);
85
	echo $o_sdc->LogGet(3);
86
87
	unlink($f_lock);
88
} else {
89
	// Act as server
90
	// Server need dup run, lock un-needed.
91
	$ar_cfg = array(
92
		'crypt_key'		=> $s_crypt_key,
93
		'default'		=> $ar_default,
94
	);
95
	$o_sdc = new SyncDbCurl($ar_cfg);
96
}
97
98
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
99