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/subscriptions/subscription-details.php (2 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * Template that prints a single subscription's details
5
 *
6
 * This template can be overridden by copying it to yourtheme/invoicing/subscriptions/subscription-details.php.
7
 *
8
 * @version 1.0.19
9
 * @var WPInv_Subscription $subscription
10
 * @var WPInv_Subscriptions_Widget $widget
11
 */
12
13
defined( 'ABSPATH' ) || exit;
14
15
do_action( 'getpaid_single_subscription_before_notices', $subscription );
16
17
// Display errors and notices.
18
wpinv_print_errors();
19
20
$subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() );
21
$subscription_group  = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() );
22
23
do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups );
24
25
?>
26
27
<h2 class="mb-1 h4"><?php esc_html_e( 'Subscription Details', 'invoicing' ); ?></h2>
28
<table class="table table-bordered">
29
	<tbody>
30
31
		<?php foreach ( $widget->get_single_subscription_columns( $subscription ) as $key => $label ) : ?>
32
33
			<tr class="getpaid-subscription-meta-<?php echo esc_attr( $key ); ?>">
34
35
				<th class="font-weight-bold" style="width: 35%">
36
					<?php echo esc_html( $label ); ?>
37
				</th>
38
39
				<td style="width: 65%">
40
					<?php
41
42
						switch ( $key ) {
43
44
						case 'status':
45
							echo esc_html( $subscription->get_status_label() );
46
							break;
47
48
						case 'start_date':
49
							echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) );
50
							break;
51
52
						case 'expiry_date':
53
							echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) );
54
							break;
55
56
						case 'initial_amount':
57
							echo wp_kses_post( wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ) );
58
59
							if ( $subscription->has_trial_period() ) {
60
61
								echo "<small class='text-muted'>&nbsp;";
62
								printf(
63
									esc_html_x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ),
64
									esc_html( $subscription->get_trial_period() )
65
								);
66
								echo '</small>';
67
68
							}
69
70
							break;
71
72
						case 'recurring_amount':
73
							$frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' );
74
							$amount    = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() );
75
							echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) );
76
							break;
77
78
						case 'item':
79
							if ( empty( $subscription_group ) ) {
80
								echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) );
81
							} else {
82
								$markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) );
83
								echo wp_kses_post( implode( ' | ', $markup ) );
84
							}
85
86
							break;
87
88
						case 'payments':
89
							$max_activations = (int) $subscription->get_bill_times();
90
							echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '&infin;' : (int) $max_activations );
91
92
							break;
93
94
						}
95
						do_action( "getpaid_render_single_subscription_column_$key", $subscription );
96
97
					?>
98
				</td>
99
100
			</tr>
101
102
		<?php endforeach; ?>
103
104
	</tbody>
105
</table>
106
107
<?php if ( ! empty( $subscription_group ) ) : ?>
108
	<h2 class='mt-5 mb-1 h4'><?php esc_html_e( 'Subscription Items', 'invoicing' ); ?></h2>
109
	<?php getpaid_admin_subscription_item_details_metabox( $subscription ); ?>
110
<?php endif; ?>
111
112
<h2 class='mt-5 mb-1 h4'><?php esc_html_e( 'Related Invoices', 'invoicing' ); ?></h2>
113
114
<?php ob_start();getpaid_admin_subscription_invoice_details_metabox( $subscription ); $invoice_details = ob_get_clean(); echo wp_kses_post( $invoice_details ); ?>
115
116
<?php if ( 1 < count( $subscription_groups ) ) : ?>
117
	<h2 class='mt-5 mb-1 h4'><?php esc_html_e( 'Related Subscriptions', 'invoicing' ); ?></h2>
118
	<?php getpaid_admin_subscription_related_subscriptions_metabox( $subscription ); ?>
119
<?php endif; ?>
120
121
<span class="form-text">
122
123
	<?php
124
		if ( $subscription->can_cancel() ) {
125
		printf(
126
            '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a>&nbsp;&nbsp;',
127
            esc_url( $subscription->get_cancel_url() ),
128
            esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ),
129
            esc_html__( 'Cancel Subscription', 'invoicing' )
130
        );
131
		}
132
133
		do_action( 'getpaid-single-subscription-page-actions', $subscription );
134
	?>
135
136
	<a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php esc_html_e( 'Go Back', 'invoicing' ); ?></a>
0 ignored issues
show
It seems like get_permalink((int)wpinv...ce_subscription_page')) can also be of type false; however, parameter $default of getpaid_get_tab_url() 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

136
	<a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', /** @scrutinizer ignore-type */ get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php esc_html_e( 'Go Back', 'invoicing' ); ?></a>
Loading history...
getpaid_get_tab_url('gp-...e_subscription_page'))) of type array is incompatible with the type string expected by parameter $url of esc_url(). ( Ignorable by Annotation )

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

136
	<a href="<?php echo esc_url( /** @scrutinizer ignore-type */ getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php esc_html_e( 'Go Back', 'invoicing' ); ?></a>
Loading history...
137
</span>
138