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.

js/DeployPlan.jsx (1 issue)

Languages
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
/* global Q */
2
3
var React = require("react");
4
5
var Events = require('./events.js');
6
var Helpers = require('./helpers.js');
7
var SummaryTable = require('./SummaryTable.jsx');
8
9
var DeployPlan = React.createClass({
10
11
	getInitialState: function() {
12
		return {
13
			loading_changes: false,
14
			deploy_disabled: false,
15
			deployHover: false
16
		};
17
	},
18
	componentDidMount: function() {
19
		var self = this;
20
		// register subscribers
21
		this.loadingSub = Events.subscribe('change_loading', function () {
22
			self.setState({
23
				loading_changes: true
24
			});
25
		});
26
		this.loadingDoneSub = Events.subscribe('change_loading/done', function () {
27
			self.setState({
28
				loading_changes: false
29
			});
30
		});
31
	},
32
	loadingSub: null,
33
	loadingDoneSub: null,
34
	deployHandler: function(event) {
35
		event.preventDefault();
36
		this.setState({
37
			deploy_disabled: true
38
		});
39
40
		Q($.ajax({
41
			type: "POST",
42
			dataType: 'json',
43
			url: this.props.context.envUrl + '/start-deploy',
44
			data: {
45
				// Pass the strategy object the user has just signed off back to the backend.
46
				strategy: this.props.summary,
47
				DispatcherSecurityID: this.props.summary.SecurityID
48
			}
49
		})).then(function(data) {
50
			window.location = data.url;
51
		}, function(data) {
52
			console.error(data); // eslint-disable-line no-console
53
		});
54
	},
55
	mouseEnterHandler: function() {
56
		this.setState({deployHover: true});
57
	},
58
	mouseLeaveHandler: function() {
59
		this.setState({deployHover: false});
60
	},
61
	canDeploy: function() {
62
		return (this.props.summary.validationCode === "success" || this.props.summary.validationCode === "warning");
63
	},
64
	actionTitle: function() {
65
		var actionTitle = this.props.summary.actionTitle;
66
		if (typeof actionTitle === 'undefined' || actionTitle === '') {
67
			return 'Make a selection';
68
		}
69
		return this.props.summary.actionTitle;
70
	},
71
	render: function() {
72
		var messages = this.props.summary.messages;
73
		var deployAction;
74
		if (this.canDeploy()) {
75
			deployAction = (
76
				<div
77
					className="section"
78
					onMouseEnter={this.mouseEnterHandler}
79
					onMouseLeave={this.mouseLeaveHandler}
80
				>
81
						<button
82
							value="Confirm Deployment"
83
							className="deploy pull-left"
84
							disabled={this.state.deploy_disabled}
85
							onClick={this.deployHandler}
86
						>
87
							{this.actionTitle()}
88
						</button>
89
						<QuickSummary
90
							activated={this.state.deployHover}
91
							context={this.props.context}
92
							summary={this.props.summary}
93
						/>
94
				</div>
95
			);
96
		}
97
98
		var headerClasses = Helpers.classNames({
99
			header: true,
100
			inactive: !this.canDeploy(),
101
			loading: this.state.loading_changes
102
		});
103
104
		return (
105
			<div>
106
				<div className="section">
107
					<div className={headerClasses}>
108
						<span className="status-icon"></span>
109
						<span className="numberCircle">2</span>
110
						&nbsp;Review changes
111
					</div>
112
					<MessageList messages={messages} />
113
					<SummaryTable changes={this.props.summary.changes} />
114
				</div>
115
				{deployAction}
116
			</div>
117
		);
118
	}
119
});
120
121
function QuickSummary(props) {
122
123
	var type = (props.summary.actionCode === 'fast' ? 'code-only' : 'full');
124
	var extraDefinitions = [];
125
	if (props.summary.estimatedTime && props.summary.estimatedTime > 0) {
126
		extraDefinitions.push(<dt key="duration_term">Duration:</dt>);
127
		extraDefinitions.push(
128
			<dd key="duration_definition">{props.summary.estimatedTime} min approx.</dd>);
129
	}
130
131
	var dlClasses = Helpers.classNames({
132
		activated: props.activated,
133
		'quick-summary': true
134
	});
135
136
	var moreInfo = null;
137
	if (typeof props.context.deployHelp !== 'undefined' && props.context.deployHelp) {
138
		moreInfo = (
139
			<a className="small" href={props.context.deployHelp}>more info</a>
140
		);
141
	}
142
143
	var env;
144
	if (props.context.siteUrl) {
145
		env = (
146
			<a href={props.context.siteUrl}>{props.context.envName}</a>
147
		);
148
	} else {
149
		env = <span>{props.context.envName}</span>;
150
	}
151
152
	return (
153
		<dl className={dlClasses}>
154
			<dt>Environment:</dt>
155
			<dd>{env}</dd>
156
			<dt>Deploy type:</dt>
157
			<dd>{type} {moreInfo}</dd>
158
			{extraDefinitions}
159
		</dl>
160
	);
161
}
162
163
var MessageList = React.createClass({
164
	render: function() {
165
		if (this.props.messages.length < 1) {
166
			return null;
167
		}
168
		if (typeof this.props.messages === 'undefined') {
169
			return null;
170
		}
171
		var idx = 0;
172
		var messages = this.props.messages.map(function(message) {
173
			idx++;
174
			return <Message key={idx} message={message} />;
175
		});
176
		return (
177
			<div>
178
				{messages}
179
			</div>
180
		);
181
	}
182
});
183
184
function Message(props) {
185
	var classMap = {
186
		error: 'alert alert-danger',
187
		warning: 'alert alert-warning',
188
		success: 'alert alert-info'
189
	};
190
	var classname = classMap[props.message.code];
191
	return (
192
		<div
193
			className={classname}
194
			role="alert"
195
			dangerouslySetInnerHTML={{__html: props.message.text}}
0 ignored issues
show
Dangerous property 'dangerouslySetInnerHTML' found
Loading history...
196
		/>
197
	);
198
}
199
200
module.exports = DeployPlan;
201