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/modules/mod_xmlrpc.php (1 issue)

Labels
Severity

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
     mod_xmlrpc.php                                        Muze Ariadne
4
     ------------------------------------------------------------------
5
     Author: Wouter Commandeur (Muze) ([email protected])
6
     Date: 05 februari 2003
7
8
     Copyright 2003 Muze
9
10
     This file is part of Ariadne.
11
12
     Ariadne is free software; you can redistribute it and/or modify
13
     it under the terms of the GNU General Public License as published
14
     by the Free Software Foundation; either version 2 of the License,
15
     or (at your option) any later version.
16
17
     Ariadne is distributed in the hope that it will be useful,
18
     but WITHOUT ANY WARRANTY; without even the implied warranty of
19
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
     GNU General Public License for more details.
21
22
     You should have received a copy of the GNU General Public License
23
     along with Ariadne; if not, write to the Free Software
24
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25
     02111-1307  USA
26
27
    -------------------------------------------------------------------
28
29
     Description:
30
31
	Wrapper module to the Pear XMLRPC library.
32
33
    ******************************************************************/
34
35
	include_once("XML/RPC.php");
36
37
	class XMLRPC {
38
39
		/* parse the given array and return a valid xmlrpc encoded array */
40
41
		function array_encode( $arguments=array(), $in_struct = 0 ) {
42
43
			$result = array();
44
45
			if( is_array( $arguments ) && (sizeof($arguments) > 0) ) {
46
				while( list($key,$value) = each( $arguments ) ) {
47
					if( is_int($key) ) {
48 View Code Duplication
						switch (gettype($value)) {
49
							case ("array"):
50
								$nest_array = XMLRPC::array_encode($value);
51
								array_push($result, new XML_RPC_Value($nest_array,"array"));
52
								break;
53
							case ("integer"):
54
								array_push($result, new XML_RPC_Value($value,"int"));
55
								break;
56
							case ("string"):
57
								array_push($result, new XML_RPC_Value($value,"string"));
58
								break;
59
							default:
60
								array_push($result, new XML_RPC_Value($value));
61
								break;
62
						}
63
					} else {
64
						$pieces = explode(":",$key);
65
						if( is_array($pieces) && ( sizeof($pieces) == 1) ) { // name
66 View Code Duplication
							switch( gettype($value) ) {
67
							case ("array"):
68
								$nest_array = XMLRPC::array_encode($value);
69
								array_push($result, new XML_RPC_Value($nest_array,"array"));
70
								break;
71
							case ("integer"):
72
								array_push($result, new XML_RPC_Value($value,"int"));
73
								break;
74
							case ("string"):
75
								array_push($result, new XML_RPC_Value($value,"string"));
76
								break;
77
							default:
78
								array_push($result, new XML_RPC_Value($value));
79
								break;
80
							}
81
						} elseif( is_array($pieces) ) { // type:name
82
							$type = $pieces[0];
83
							$name = $pieces[1];
84
							switch( $type ) {
85 View Code Duplication
								case ("struct"):
86
									$nest = XMLRPC::array_encode($value,1);
87
									if( $name == "" || $in_struct == 0 ) {
88
										array_push($result, new XML_RPC_Value($nest,$type));
89
									} else {
90
										$result[$name] = new XML_RPC_Value($nest,$type);
91
									}
92
									break;
93 View Code Duplication
								case ("array"):
94
									$nest = XMLRPC::array_encode($value);
95
									if( $name == "" || $in_struct == 0 ) {
96
										array_push($result, new XML_RPC_Value($nest,$type));
97
									} else {
98
										$result[$name] = new XML_RPC_Value($nest,$type);
99
									}
100
									break;
101
								case ("datetime"):
102
									if( is_int($value) ) {
103
										$datetime = XML_RPC_iso8601_encode($value);
104
									} else {
105
										$datetime = $value;
106
									}
107
									if( $name == "" || $in_struct == 0 ) {
108
										array_push($result, new XML_RPC_Value($datetime,"dateTime.iso8601"));
109
									} else {
110
										$result[$name] = new XML_RPC_Value($datetime,$type);
111
									}
112
									break;
113
								case ("i4"):
114
								case ("int"):
115
								case ("double"):
116
								case ("base64"):
117
								case ("string"):
118
								case ("boolean"):
119
								default:
120
									if( $name == "" || $in_struct == 0) {
121
										array_push($result, new XML_RPC_Value($value, $type));
122
									} else {
123
										$result[$name] = new XML_RPC_Value($value, $type);
124
									}
125
									break;
126
								break;
127
							}
128
						}
129
					}
130
				}
131
			}
132
			return $result;
133
		}
134
135
		function call( $url="",$function="",$arguments=array() ) {
136
		$arguments = XMLRPC::array_encode($arguments);
137
138
			$myResult = XMLRPC::call_raw($url,$function,$arguments);
139
140
			if( !$myResult ) {
141
				$result = "XMLRPC::Error ErrNo: ".$myClient->errno." ErrStr: ".$myClient->errstr;
0 ignored issues
show
The variable $myClient does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
142
			} else {
143
				if( $myResult->faultCode() ) {
144
					$result = "XMLRPC::ResultError Code: ".$myResult->faultCode()." Reason: ".$myResult->faultString();
145
				} else {
146
					// We have a valid response
147
					$result = array( XML_RPC_Decode( $myResult->Value() ) );
148
				}
149
			}
150
			return $result;
151
		}
152
153
		function call_raw( $url="", $function="", $arguments=array() ) {
154
155
			// parse the given url find: server, path, port
156
			// http://host:port/path/
157
158
			preg_match("/^([htps]*:\/\/)?([^\/:]+)(:[^\/]+)?(.*)/i", $url, $matches);
159
160
			$myHost = $matches[2];
161
			$myPort = substr($matches[3],1);
162
			if( !$matches[3] ) {
163
			  $myPort = 80;
164
			}
165
			$myPath = $matches[4];
166
167
			$myFunction = $function;
168
169
			$myArguments = $arguments;
170
171
			$myClient = new XML_RPC_Client($myPath, $myHost, $myPort);
172
173
			$myMessage = new XML_RPC_Message($myFunction, $myArguments);
174
175
			$myResult = $myClient->send($myMessage);
176
177
			return $myResult;
178
		}
179
	}
180
181
class pinp_XMLRPC extends XMLRPC {
182
183
	function _call( $url="", $function="", $arguments=array() ) {
184
		return $this->call( $url, $function, $arguments );
185
	}
186
}
187