Issues (850)

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/invoice-history.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Template that prints the invoice history page.
4
 *
5
 * This template can be overridden by copying it to yourtheme/invoicing/invoice-history.php.
6
 *
7
 * @version 1.0.19
8
 */
9
10
defined( 'ABSPATH' ) || exit;
11
12
// Current page.
13
$current_page   = empty( $_GET['page'] ) ? 1 : absint( $_GET['page'] );
14
15
// Fires before displaying user invoices.
16
do_action( 'wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type );
17
18
wpinv_print_errors();
19
20
?>
21
22
23
	<div class="table-responsive">
24
		<table class="table table-bordered table-hover getpaid-user-invoices <?php echo esc_attr( $post_type ); ?>">
25
26
27
			<thead>
28
				<tr>
29
30
					<?php foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : ?>
31
						<th class="<?php echo esc_attr( $column_id ); ?> <?php echo ( ! empty( $column_name['class'] ) ? sanitize_html_class( $column_name['class'] ) : ''); ?> border-bottom-0">
32
							<span class="nobr"><?php echo esc_html( $column_name['title'] ); ?></span>
33
						</th>
34
					<?php endforeach; ?>
35
36
				</tr>
37
			</thead>
38
39
40
41
			<tbody>
42
				<?php foreach ( $invoices->invoices as $invoice ) : ?>
43
44
					<tr class="wpinv-item wpinv-item-<?php echo esc_attr( $invoice->get_status() ); ?>">
45
						<?php
46
47
							foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) :
48
49
							$column_id = sanitize_html_class( $column_id );
50
							$class     = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] );
51
52
							echo "<td class='" . esc_attr( $column_id . ' ' . $class ) . "'>";
53
							switch ( $column_id ) {
54
55
								case 'invoice-number':
56
									echo wp_kses_post( wpinv_invoice_link( $invoice ) );
57
									break;
58
59
								case 'created-date':
60
									echo esc_html( getpaid_format_date_value( $invoice->get_date_created() ) );
61
									break;
62
63
								case 'payment-date':
64
									if ( $invoice->needs_payment() ) {
65
										echo '&mdash;';
66
										} else {
67
										echo esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) );
68
										}
69
70
									break;
71
72
								case 'invoice-status':
73
									echo wp_kses_post( $invoice->get_status_label_html() );
74
75
									break;
76
77
								case 'invoice-total':
78
									wpinv_the_price( $invoice->get_total(), $invoice->get_currency() );
79
80
									break;
81
82
								case 'invoice-actions':
83
									$actions = array(
84
85
										'pay'   => array(
86
											'url'   => $invoice->get_checkout_payment_url(),
87
											'name'  => __( 'Pay Now', 'invoicing' ),
88
											'class' => 'btn-success',
89
										),
90
91
										'print' => array(
92
											'url'   => $invoice->get_view_url(),
93
											'name'  => __( 'View', 'invoicing' ),
94
											'class' => 'btn-secondary',
95
											'attrs' => 'target="_blank"',
96
										),
97
									);
98
99
									if ( ! $invoice->needs_payment() ) {
100
										unset( $actions['pay'] );
101
										}
102
103
									if ( $invoice->needs_payment() ) {
104
										$actions['delete'] = array(
105
											'url'   => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ),
106
											'name'  => __( 'Delete', 'invoicing' ),
107
											'class' => 'btn-danger',
108
										);
109
										}
110
111
									$actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type );
112
113
									foreach ( $actions as $key => $action ) {
114
										$class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : '';
115
										echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $action['name'] ) . '</a>';
116
										}
117
118
									break;
119
120
								default:
121
									do_action( "wpinv_user_invoices_column_$column_id", $invoice );
122
									break;
123
124
125
								}
126
127
							do_action( "wpinv_user_invoices_column_after_$column_id", $invoice );
128
129
							echo '</td>';
130
131
							endforeach;
132
						?>
133
					</tr>
134
135
				<?php endforeach; ?>
136
137
			</tbody>
138
		</table>
139
	</div>
140
141
	<?php do_action( 'wpinv_before_user_invoices_pagination' ); ?>
142
143
	<?php if ( 1 < $invoices->max_num_pages ) : ?>
144
		<div class="invoicing-Pagination">
145
			<?php
146
			$big = 999999;
147
148
			echo wp_kses_post(
149
				paginate_links(
0 ignored issues
show
It seems like paginate_links(array('ba...voices->max_num_pages)) can also be of type string[]; however, parameter $data of wp_kses_post() 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

149
				/** @scrutinizer ignore-type */ paginate_links(
Loading history...
150
					array(
151
						'base'   => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
152
						'format' => '?paged=%#%',
153
						'total'  => $invoices->max_num_pages,
154
					)
155
				)
156
            );
157
			?>
158
		</div>
159
	<?php endif; ?>
160
161
<?php do_action( 'wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); ?>
162