Issues (1751)

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.

lib/ar/connect/xmlrpc.php (1 issue)

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
global $AR;
3
require_once($AR->dir->install."/lib/includes/ripcord/ripcord.php");
4
5
ar_pinp::allow('ar_connect_xmlrpc');
6
ar_pinp::allow('ar_connect_xmlrpcClient');
7
ar_pinp::allow('ar_connect_xmlrpcServer');
8
9
// FIXME: define interfaces
10
11
class ar_connect_xmlrpc extends arBase {
12
13
	private static function services( $methods ) {
14
		$result = array();
15
		foreach ($methods as $methodName => $method) {
16
			if ( !($method instanceof \Closure) ) {
17
				$params = array();
18
				if (is_array($method)) {
19
					$template = array_shift($method);
20
					$params   = $method;
21
				} else {
22
					$template = $method;
23
				}
24
				$result[$methodName] = ar_pinp::getCallback($template, $params);
25
			} else {
26
				$result[$methodName] = $method;
27
			}
28
		}
29
		return $result;
30
	}
31
32
	public static function client($url, $options = null) {
33
		try {
34
			return new ar_connect_xmlrpcClient( ripcord::client($url, $options) );
35
		} catch( Ripcord_Exception $e ) {
36
			return new ar_error($e->getMessage(), $e->getCode() );
37
		}
38
	}
39
40
	public static function server($methods, $options = null, $documentation = false) {
41
		try {
42
			return new ar_connect_xmlrpcServer( ripcord::server(
43
				self::services( $methods ),
44
				$options,
45
				$documentation ? new ar_connect_xmlrpcDocumentor( $options, $documentation ) : false
46
			) );
47
		} catch( Ripcord_Exception $e ) {
48
			return new ar_error($e->getMessage(), $e->getCode() );
49
		}
50
	}
51
52
	public static function base64($binary) {
53
		return ripcord::base64( $binary );
54
	}
55
56
	public static function binary($base64) {
57
		try {
58
			return ripcord::binary( $base64 );
59
		} catch( Ripcord_Exception $e ) {
60
			return new ar_error($e->getMessage(), $e->getCode() );
61
		}
62
	}
63
64
	public static function datetime($timestamp) {
65
		return ripcord::datetime($timestamp);
66
	}
67
68
	public static function timestamp($datetime) {
69
		try {
70
			return ripcord::timestamp($datetime);
71
		} catch( Ripcord_Exception $e ) {
72
			return new ar_error($e->getMessage(), $e->getCode() );
73
		}
74
	}
75
76
	public static function fault($code, $message) {
77
		return ripcord::fault($code, $message);
78
	}
79
80
	public static function isFault($fault) {
81
		return ripcord::isFault($fault);
82
	}
83
84
	public static function getType($arg) {
85
		return ripcord::getType($arg);
86
	}
87
88
	public static function encodeCall() {
89
		$params = func_get_args();
90
		return call_user_func_array( array('ripcord', 'encodeCall'), $params );
91
	}
92
}
93
94
class ar_connect_xmlrpcClient extends arBase {
95
	private $wrapped = null;
96
97
	public function __construct( $wrapped ) {
98
		$this->wrapped = $wrapped;
99
	}
100
101
	public function __get($name) {
102
		$result = $this->wrapped->{$name};
103
		if ( $result instanceof Ripcord_Client ) {
104
			try {
105
				return new ar_connect_xmlrpcClient($result); // FIXME: use clone here instead?
106
			} catch( Ripcord_Exception $e ) {
107
				return new ar_error($e->getMessage(), $e->getCode() );
108
			}
109
		} else {
110
			return $result;
111
		}
112
	}
113
114
	public function __call($method, $params) {
115
		try {
116
			if ($method[0]=='_') {
117
				$method = substr($method, 1);
118
			}
119
			$result = $this->wrapped->__call($method, $params);
120
			if ( $result instanceof Ripcord_Client ) {
121
				return new ar_connect_xmlrpcClient($result);
122
			} else {
123
				return $result;
124
			}
125
		} catch( Ripcord_Exception $e ) {
126
			return new ar_error($e->getMessage(), $e->getCode() );
127
		}
128
	}
129
130
	public function __set($name, $value) {
131
		$this->wrapped->{$name} = $value;
132
	}
133
}
134
135
class ar_connect_xmlrpcServer extends arBase {
136
	private $wrapped = null;
137
138
	public function __construct( $wrapped ) {
139
		$this->wrapped = $wrapped;
140
	}
141
142
	public function __get($name) {
143
		$result = $this->wrapped->{$name};
144
		return $result;
145
	}
146
147
	public function __call($method, $params) {
148
		if ($method[0]=='_') {
149
			$method = substr($method, 1);
150
		}
151
		return call_user_func_array( array($this->wrapped, $method), $params);
152
	}
153
154
	public function __set($name, $value) {
155
		$this->wrapped->{$name} = $value;
156
	}
157
}
158
159
class ar_connect_xmlrpcDocumentor extends arBase implements Ripcord_Documentor_Interface {
160
	private $documentation = null;
161
162
	public function __construct( $options = null ) { // FIXME: this is evil. Ripcord_Documentor_Interface no longer has __construct in it.
0 ignored issues
show
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
163
		$args = func_get_args();
164
		if (isset($args[1])) {
165
			$this->documentation = $args[1];
166
		}
167
	}
168
169
	public function getIntroSpectionXML() {
170
		return false;
171
	}
172
173
	public function setMethodData($methods) {
174
		return false;
175
	}
176
177
	public function handle($request) {
178
		echo $this->documentation;
179
	}
180
}
181