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.

tests/unit/FileNlsTest.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
3
class FileNlsTest extends AriadneBaseTest
4
{
5
6
	public function setUp()
7
	{
8
		$this->initAriadne();
9
	}
10
11
	public function testDefaultNLS() {
12
		global $AR;
13
14
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
15
		$defaultnls = $obj->data->nls->default;
16
17
		$one = trim($obj->getFile('file',$defaultnls));
18
		$two = trim($obj->getFile());
19
		$this->assertEquals('taal '.$defaultnls,$one);
20
		$this->assertEquals($one,$two);
21
	}
22
23
	public function testAllNLS() {
24
		global $AR;
25
26
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
27
28
		foreach($obj->data->nls->list as $nls => $language) {
29
			$content = $obj->getFile('file',$nls);
30
			$content = trim($content);
31
			$this->assertEquals('taal '.$nls , $content);
32
		}
33
	}
34
35
	public function testAllNLSPlain() {
36
		global $AR;
37
38
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
39
40
		foreach($obj->data->nls->list as $nls => $language) {
41
			$content = $obj->getPlainText('file',$nls);
42
			$content = trim($content);
43
			$this->assertEquals('taal '.$nls , $content);
44
		}
45
	}
46
47
	public function testAllNLSShow() {
48
		global $AR;
49
50
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
51
		foreach($obj->data->nls->list as $nls => $language) {
52
			ob_start();
53
			$obj->ShowFile('file',$nls);
54
			$content  = ob_get_contents();
55
			ob_end_clean();
56
			$content = trim($content);
57
			$this->assertEquals('taal '.$nls , $content);
58
		}
59
	}
60
61 View Code Duplication
	public function testunavailableNls() {
62
		global $AR;
63
64
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
65
		$content = $obj->getFile('file','zz');
66
		$content = trim($content);
67
		$this->assertEquals('taal '.$obj->data->nls->default , $content);
68
	}
69
70 View Code Duplication
	public function testUnavailableNlsPlain() {
71
		global $AR;
72
73
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
74
		$nls = $obj->data->nls->default;
75
		$content = $obj->getPlainText('file','zz');
76
		$content = trim($content);
77
		$this->assertEquals('taal '.$nls , $content);
78
	}
79
80
	public function testunavailableNlsChangeDefault() {
81
		global $AR;
82
83
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
84
		$nls = $obj->data->nls->default;
85
		$obj->data->nls->default = 'de';
86
		$content = $obj->getFile('file','zz');
87
		$content = trim($content);
88
		$this->assertNotEquals('taal '.$nls , $content);
89
	}
90
91
	public function testAllNLSPlainHTML() {
92
		global $AR;
93
94
		$obj =current(ar::get(TESTBASE.'/file-nls/file-html/')->call('system.get.phtml'));
95
96
		foreach($obj->data->nls->list as $nls => $language) {
97
			$content = $obj->getPlainText('file',$nls);
98
			$content = trim($content);
99
			$this->assertEquals($nls , $content);
100
		}
101
	}
102
	public function testAllNLSPlainPDF() {
103
		global $AR;
104
105
		$obj =current(ar::get(TESTBASE.'/file-nls/file-pdf/')->call('system.get.phtml'));
106
107
		foreach($obj->data->nls->list as $nls => $language) {
108
			$content = $obj->getPlainText('file',$nls);
109
			$content = trim($content);
110
			$this->assertEquals($nls , $content);
111
		}
112
	}
113
114
	public function testSaveExistingFile() {
115
		global $AR,$ARCurrent;
116
		$content = 'testfrmlfrop';
117
		$obj  = current(ar::get(TESTBASE.'/file-nls/file-nls/' )->call('system.get.phtml'));
118
119
		$res = $obj->SaveFile($content ,'text/plain', 'newfile', $obj->nls);
120
		$this->assertEquals(strlen($content), $res);
121
122
		$res = $obj->GetFile('newfile', $obj->nls);
123
		$this->assertEquals($content, $res);
124
	}
125
126
	public function testParseFile() {
127
		global $AR;
128
129
		$obj =current(ar::get(TESTBASE.'/file-nls/file-nls/')->call('system.get.phtml'));
130
		foreach($obj->data->nls->list as $nls => $language) {
131
			$content = $obj->ParseFile('file',$nls);
132
			$content = trim($content);
133
			$this->assertEquals('taal '.$nls , $content);
134
		}
135
	}
136
137
/*
138
	TODO:
139
		- save file for new object
140
		- showfile
141
			- mimetype
142
			- headers
143
		- download file
144
			- file
145
			- mimetype
146
			- headers
147
*/
148
}
149
?>
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...
150