Issues (865)

Security Analysis    4 potential vulnerabilities

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection (1)
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection (2)
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  Cross-Site Scripting (1)
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.
  Header Injection
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.

templates/payment-forms/elements/file_upload.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Displays a file_upload input in a payment form
4
 *
5
 * This template can be overridden by copying it to yourtheme/invoicing/payment-forms/elements/file_upload.php.
6
 *
7
 * @version 2.8.9
8
 */
9
10
defined( 'ABSPATH' ) || exit;
11
12
$label        = empty( $label ) ? '' : wp_kses_post( $label );
13
$label_class  = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14
$id           = esc_attr( $id );
15
$_id          = $id . uniqid( '_' );
16
$max_file_num = empty( $max_file_num ) ? 1 : absint( $max_file_num );
17
$file_types   = empty( $file_types ) ? array( 'jpg|jpeg|jpe', 'gif', 'png' ) : $file_types;
18
$all_types    = getpaid_get_allowed_mime_types();
19
$types        = array();
20
$_types       = array();
21
22
foreach ( $file_types as $file_type ) {
23
24
	if ( isset( $all_types[ $file_type ] ) ) {
25
		$types[]   = $all_types[ $file_type ];
26
		$file_type = explode( '|', $file_type );
27
28
		foreach ( $file_type as $type ) {
29
			$type     = trim( $type );
30
			$types[]  = ".$type";
31
			$_types[] = $type;
32
		}
33
}
34
}
35
36
if ( ! empty( $required ) ) {
37
	$label .= "<span class='text-danger'> *</span>";
38
}
39
?>
40
<label><span v-html="form_element.label"></span></label>
41
<div class="form-group mb-3 <?php echo esc_attr( $label_class ); ?>" data-name="<?php echo esc_attr( $id ); ?>" data-max="<?php echo esc_attr( $max_file_num ); ?>">
42
	<label for="<?php echo esc_attr( $id ); ?>"><?php echo wp_kses_post( $label ); ?></label>
43
	<input type="file" class="sr-only getpaid-files-input" id="<?php echo esc_attr( $id ); ?>" accept="<?php echo esc_attr( implode( ', ', $types ) ); ?>" data-extensions="<?php echo esc_attr( wp_json_encode( $_types ) ); ?>" <?php echo $max_file_num == 1 ? '' : 'multiple="multiple"'; ?>>
0 ignored issues
show
It seems like wp_json_encode($_types) can also be of type false; however, parameter $text of esc_attr() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

43
	<input type="file" class="sr-only getpaid-files-input" id="<?php echo esc_attr( $id ); ?>" accept="<?php echo esc_attr( implode( ', ', $types ) ); ?>" data-extensions="<?php echo esc_attr( /** @scrutinizer ignore-type */ wp_json_encode( $_types ) ); ?>" <?php echo $max_file_num == 1 ? '' : 'multiple="multiple"'; ?>>
Loading history...
44
	<label for="<?php echo esc_attr( $id ); ?>" class="getpaid-file-upload-element d-flex w-100 flex-column align-items-center justify-content-center p-2 mb-2">
45
		<div class="h5 text-dark">
46
			<?php echo esc_html( ( $max_file_num > 1 ? __( 'Drag files to this area or click to upload', 'invoicing' ) : __( 'Drag your file to this area or click to upload', 'invoicing' ) ) ); ?>
47
		</div>
48
		<?php if ( ! empty( $description ) ) : ?>
49
			<small class="form-text text-muted"><?php echo wp_kses_post( $description ); ?></small>
50
		<?php endif; ?>
51
	</label>
52
	<div class="getpaid-uploaded-files"></div>
53
	<div class="form-row row mb-3 d-none getpaid-progress-template">
54
		<div class="overflow-hidden text-nowrap col-7 col-sm-4">
55
			<a href="" class="close float-none" title="<?php esc_attr_e( 'Remove File', 'invoicing' ); ?>">&times;<span class="sr-only"><?php esc_html_e( 'Close', 'invoicing' ); ?></span></a>&nbsp;
56
			<i class="fa fa-file" aria-hidden="true"></i>&nbsp; <span class="getpaid-progress-file-name"></span>&nbsp;
57
		</div>
58
		<div class="col-5 col-sm-8 getpaid-progress">
59
			<div class="progress" style="height: 40px">
60
				<div class="progress-bar" role="progressbar" style="width: 0" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
61
			</div>
62
		</div>
63
	</div>
64
</div>
65