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/containers/DeployHistory.jsx (5 issues)

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
const React = require('react');
2
const ReactRedux = require('react-redux');
3
const Pagination = require('react-bootstrap/lib/Pagination');
4
const BuildStatus = require('../components/BuildStatus.jsx');
5
const LoadingBar = require('../components/LoadingBar.jsx');
6
7
const _ = require('underscore');
8
const actions = require('../_actions.js');
9
const deployStates = require('../constants/deployment.js');
10
11
const DeployHistory = function(props) {
12
	let errorRow = null;
13
	let pagination = null;
14
15
	if (props.error) {
16
		errorRow = (
17
			<tr className="danger">
18
				<td colSpan="5">
19
					{props.error}
20
				</td>
21
			</tr>
22
		);
23
	}
24
25
	if (props.total_pages > 1) {
26
		pagination = (
27
			<div className="text-center">
28
				<nav>
29
					<Pagination
30
						first
31
						last
32
						maxButtons={6}
33
						items={props.total_pages}
34
						activePage={props.current_page}
35
						onSelect={props.onPageClick}
36
					/>
37
				</nav>
38
			</div>
39
		);
40
	}
41
42
	return (
43
		<div className="fade-in">
44
			<h4>History</h4>
45
			<div className="table-responsive">
46
				<table className="table table-clickable table-centered-columns table-striped table-hover">
47
					<thead>
48
						<tr>
49
							<th>Deploy date</th>
50
							<th>Build details</th>
51
							<th>Approval</th>
52
							<th>Deployed by</th>
53
							<th>Status</th>
54
						</tr>
55
					</thead>
56
					<tbody>
57
						{errorRow}
58
						{
59
							Object.keys(props.list).map(function(i) {
60
								const row = props.list[i];
61
								const state = row.is_current_build ? 'Current' : row.state;
62
								return (
63
									<tr className={"fade-in status-" + state} onClick={() => props.onItemClick(row.id)} key={i}>
0 ignored issues
show
This line exceeds the maximum configured line length of 120.
Loading history...
Visible, non-interactive elements should not have mouse or keyboard event listeners
Loading history...
64
										<td>{row.date_started_nice}</td>
65
										<td><BuildStatus deployment={row} /></td>
66
										<td>{row.approver ? row.approver.name : <span className="bypassed">Bypassed</span>}</td>
0 ignored issues
show
This line exceeds the maximum configured line length of 120.
Loading history...
67
										<td>{row.deployer ? row.deployer.name : null}</td>
68
										<td className="deploy-status"><span className="deploy-status-text">{state}</span></td>
0 ignored issues
show
This line exceeds the maximum configured line length of 120.
Loading history...
69
									</tr>
70
								);
71
							})
72
						}
73
					</tbody>
74
				</table>
75
				<LoadingBar show={props.is_loading} />
76
			</div>
77
			{pagination}
78
		</div>
79
	);
80
};
81
82
const mapStateToProps = function(state) {
83
84
	// try to find the current build in the list of all deployments
85
	let historyList = {};
86
	let numDeployments = 0;
87
	if (typeof state.deployment.list === "object") {
88
		historyList = _.filter(state.deployment.list, function(deploy) {
89
			switch (deploy.state) {
90
				case deployStates.STATE_COMPLETED:
91
				case deployStates.STATE_INVALID:
92
				case deployStates.STATE_FAILED:
93
					numDeployments += 1;
94
					return true;
95
				default:
96
					return false;
97
			}
98
		});
99
	}
100
	historyList.sort(function(a, b) {
101
		return Date.parse(b.date_started) - Date.parse(a.date_started);
102
	});
103
104
	const perPage = 10;
105
	// only show paginated result, recalc
106
	const start = (state.deployment.current_page - 1) * perPage;
107
	const end = start + perPage;
108
	const totalPages = Math.ceil(numDeployments / perPage);
109
110
	const paginatedList = {};
111
	let pos = 0;
112
	Object.keys(historyList).forEach(function(key) {
113
		if (pos >= start && pos < end) {
114
			paginatedList[key] = historyList[key];
115
		}
116
		pos++;
0 ignored issues
show
As per coding-style, please do not use ++, but use += 1 instead.
Loading history...
117
	});
118
119
	return {
120
		list: paginatedList,
121
		page_length: perPage,
122
		total_pages: totalPages,
123
		current_page: state.deployment.current_page,
124
		error: state.deployment.history_error,
125
		is_loading: state.deployment.history_is_loading
126
127
	};
128
};
129
130
const mapDispatchToProps = function(dispatch) {
131
	return {
132
		onItemClick: function(id) {
133
			actions.history.push('/deployment/' + id.toString());
134
		},
135
		onPageClick: function(page) {
136
			dispatch(actions.setDeployHistoryPage(page));
137
		}
138
	};
139
};
140
141
module.exports = ReactRedux.connect(mapStateToProps, mapDispatchToProps)(DeployHistory);
142