Issues (524)

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.

code/backends/DemoDeploymentBackend.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
/**
4
 * This demo back-end doesn't actually do deployment.
5
 *
6
 * Whenever you deploy, it will track the deployment history in a text file assets/<environment>.deploy-history.txt
7
 *
8
 * It's useful for demonstrating how the system works, and how you can write deployment back-ends
9
 */
10
class DemoDeploymentBackend extends Object implements DeploymentBackend {
11
12
	/**
13
	 * Create a deployment strategy.
14
	 *
15
	 * @param \DNEnvironment $environment
16
	 * @param array $options
17
	 *
18
	 * @return DeploymentStrategy
19
	 */
20
	public function planDeploy(\DNEnvironment $environment, $options = array()) {
21
		return new DeploymentStrategy($environment, $options);
22
	}
23
24
	/**
25
	 * Deploy the given build to the given environment
26
	 *
27
	 * @param \DNEnvironment $environment
28
	 * @param \DeploynautLogFile $log
29
	 * @param \DNProject $project
30
	 * @param array $options
31
	 */
32
	public function deploy(
33
		\DNEnvironment $environment,
34
		\DeploynautLogFile $log,
35
		\DNProject $project,
36
		$options
37
	) {
38
		$sha = $options['sha'];
39
40
		$this->extend('deployStart', $environment, $sha, $log, $project);
41
42
		$file = sprintf('%s/%s.deploy-history.txt', DEPLOYNAUT_LOG_PATH, $environment->getFullName());
43
		$CLI_file = escapeshellarg($file);
44
		$CLI_line = escapeshellarg(date('Y-m-d H:i:s') . " => $sha");
45
46
		// Put maintenance page up
47
		$this->enableMaintenance($environment, $log, $project);
48
49
		// Do the deployment
50
		$log->write("Demo deployment: echo $CLI_line >> $CLI_file");
51
		`echo $CLI_line >> $CLI_file`;
52
		$log->write("Arbitrary pause for 10s");
53
		sleep(10);
54
		$log->write("Well, that was a waste of time");
55
56
		// Once the deployment has run it's necessary to update the maintenance page status
57
		if(!empty($options['leaveMaintenancePage'])) {
58
			$this->enableMaintenance($environment, $log, $project);
59
		} else {
60
			// Remove maintenance page if we want it to
61
			$this->disableMaintenance($environment, $log, $project);
62
		}
63
64
		$this->extend('deployEnd', $environment, $sha, $log, $project);
65
	}
66
67
	/**
68
	 * @param \DNEnvironment $environment
69
	 * @return ArrayList
70
	 */
71
	public function getDeployOptions(\DNEnvironment $environment) {
72
		return new ArrayList();
73
	}
74
75
	/**
76
	 * @inheritdoc
77
	 */
78
	public function dataTransfer(\DNDataTransfer $dataTransfer, \DeploynautLogFile $log) {
79
		die('Not implemented');
0 ignored issues
show
Coding Style Compatibility introduced by
The method dataTransfer() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
80
	}
81
82
	public function enableMaintenance(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) {
83
		$log->write(sprintf('Maintenance page enabled on "%s"', $environment->getFullName()));
84
	}
85
86
	public function disableMaintenance(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) {
87
		$log->write(sprintf('Maintenance page disabled on "%s"', $environment->getFullName()));
88
	}
89
90
	public function ping(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) {
91
		$log->write(sprintf('Ping "%s"', $environment->getFullName()));
92
	}
93
94
}
95