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/deploy_key_test.jsx (2 issues)

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
var React = require("react");
2
3
var DeployKeyTest = React.createClass({
4
5
	getInitialState: function() {
6
		return {
7
			loading: false,
8
			tested: false,
9
			canAccessRepo: this.props.initialCanAccessRepo
10
		};
11
	},
12
13
	testAccess: function() {
14
		this.setState({ loading: true });
15
		$.ajax({
16
			url: this.props.deployKeyTestUrl,
17
			dataType: 'json',
18
			cache: false,
19
			type: 'GET',
20
			success: function(data) {
21
				this.setState({
22
					loading: false,
23
					tested: true,
24
					canAccessRepo: data.canAccessRepo
25
				});
26
			}.bind(this),
27
			error: function() {
28
				this.setState({
29
					loading: false,
30
					tested: true,
31
					canAccesRepo: false
32
				});
33
			}.bind(this)
34
		});
35
	},
36
37
	handleTestAccess: function(e) {
38
		e.preventDefault();
39
		this.testAccess();
40
	},
41
42
	button: function() {
43
		var buttonText = { __html: 'Test Access' };
44
		var buttonDisabled = false;
45
		var buttonClass = 'btn btn-primary';
46
		if (!this.props.deployKey) {
47
			buttonDisabled = true;
48
			buttonClass = 'btn';
49
		} else if (this.state.loading) {
50
			buttonText = { __html: '<i class="fa fa-cog fa-spin"></i> Attempting to clone repository...' };
51
			buttonDisabled = true;
52
		} else if (this.state.canAccessRepo) {
53
			buttonText = { __html: '<i class="fa fa-check"></i> We can access your repository' };
54
			buttonDisabled = true;
55
			buttonClass = 'btn btn-success';
56
		}
57
58
		var msg;
59
		if (this.state.tested && !this.state.canAccessRepo && !this.state.loading) {
60
			msg = (
61
				<p className='alert alert-danger'>
62
					We're having trouble accessing your repository.
63
				</p>
64
			);
65
		}
66
67
		var button = (
68
			<button
0 ignored issues
show
Only set one of children or props.dangerouslySetInnerHTML
Loading history...
69
				href="#"
70
				className={buttonClass}
71
				onClick={this.handleTestAccess}
72
				disabled={buttonDisabled}
73
				dangerouslySetInnerHTML={buttonText}
0 ignored issues
show
Dangerous property 'dangerouslySetInnerHTML' found
Loading history...
74
			>
75
			</button>
76
		);
77
78
		return (
79
			<div>
80
				{msg}
81
				{button}
82
			</div>
83
		);
84
	},
85
86
	render: function() {
87
88
		var key = null;
89
90
		if (this.props.deployKey) {
91
			key = (
92
				<textarea
93
					className="vert readonly deploy-key"
94
					rows="6"
95
					readOnly
96
					defaultValue={this.props.deployKey}
97
				/>
98
			);
99
		} else {
100
			key = (
101
				<div className="alert alert-error">
102
					Something bad happened and we were not able to create your deploy key - support has been alerted.
103
					Please contact the helpdesk if the key does not appear on your stack page soon.
104
				</div>
105
			);
106
		}
107
108
		var deployKeyHelp = null;
109
		if (this.props.repoInterface === 'Github') {
110
			deployKeyHelp = (
111
				<p>
112
					<i className="fa fa-github"></i>
113
					<a href="https://developer.github.com/guides/managing-deploy-keys/#deploy-keys">
114
						Deploy key help
115
					</a>
116
				</p>
117
			);
118
		} else if (this.props.repoInterface === 'Bitbucket') {
119
			deployKeyHelp = (
120
				<p>
121
					<i className="fa fa-bitbucket"></i>
122
					<a href="https://confluence.atlassian.com/bitbucket/use-deployment-keys-294486051.html">
123
						Deploy key help
124
					</a>
125
				</p>
126
			);
127
		} else if (this.props.repoInterface === 'Gitlab') {
128
			deployKeyHelp = (
129
				<p>
130
					<img
131
						src="deploynaut/img/gitlab.png"
132
						alt="Gitlab"
133
						className="gitlab-icon"
134
					/>
135
					<a href="http://doc.gitlab.com/ce/ssh/README.html#deploy-keys">
136
						Deploy key help
137
					</a>
138
				</p>
139
			);
140
		} else {
141
			deployKeyHelp = (
142
				<ul className="list-inline">
143
					<li><i className="fa fa-github"></i>
144
						<a href="https://developer.github.com/guides/managing-deploy-keys/#deploy-keys">
145
							Github
146
						</a>
147
					</li>
148
					<li>
149
						<i className="fa fa-bitbucket"></i>
150
						<a href="https://confluence.atlassian.com/bitbucket/use-deployment-keys-294486051.html">
151
							Bitbucket
152
						</a>
153
					</li>
154
					<li>
155
						<img src="deploynaut/img/gitlab.png" alt="Gitlab" className="gitlab-icon" />
156
						<a href="http://doc.gitlab.com/ce/ssh/README.html#deploy-keys">
157
							Gitlab
158
						</a>
159
					</li>
160
				</ul>
161
			);
162
		}
163
164
		return (
165
			<div className="add-deploy-key">
166
				<h2>One more thing...</h2>
167
				<div className="row">
168
					<div className="col-md-6 col-md-offset-3">
169
						<p>
170
							Whilst your environments are being built, please ensure we can
171
							access your private repositories by adding the deploy key below and testing access.
172
						</p>
173
						{deployKeyHelp}
174
					</div>
175
				</div>
176
				<div className="col-md-8 col-md-offset-2 text-left" id="deploy-key-test-holder">
177
					{key}
178
				</div>
179
				<div className="row">
180
					<div className="col-md-8 col-md-offset-2">
181
						{this.button()}
182
					</div>
183
				</div>
184
			</div>
185
		);
186
	},
187
188
});
189
190
module.exports = DeployKeyTest;
191