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.

widgets/invoice-receipt.php (1 issue)

1
<?php
2
if ( ! defined( 'ABSPATH' ) ) {
3
    exit;
4
}
5
6
/**
7
 * Invoice receipt widget.
8
 */
9
class WPInv_Receipt_Widget extends WP_Super_Duper {
10
11
	/**
12
	 * Register the widget with WordPress.
13
	 *
14
	 */
15
	public function __construct() {
16
17
		$options = array(
18
			'textdomain'     => 'invoicing',
19
			'block-icon'     => 'admin-site',
20
			'block-category' => 'widgets',
21
			'block-keywords' => "['invoicing','receipt']",
22
			'class_name'     => __CLASS__,
23
			'base_id'        => 'wpinv_receipt',
24
			'name'           => __( 'GetPaid > Invoice Receipt', 'invoicing' ),
25
			'widget_ops'     => array(
26
				'classname'   => 'wpinv-receipt-class bsui',
27
				'description' => esc_html__( 'Displays invoice receipt after checkout.', 'invoicing' ),
28
			),
29
			'arguments'      => array(
30
				'title' => array(
31
					'title'    => __( 'Widget title', 'invoicing' ),
32
					'desc'     => __( 'Enter widget title.', 'invoicing' ),
33
					'type'     => 'text',
34
					'desc_tip' => true,
35
					'default'  => '',
36
					'advanced' => false,
37
				),
38
			),
39
40
		);
41
42
		parent::__construct( $options );
43
	}
44
45
	/**
46
	 * The Super block output function.
47
	 *
48
	 * @param array $args
49
	 * @param array $widget_args
50
	 * @param string $content
51
	 *
52
	 * @return mixed|string|bool
53
	 */
54
	public function output( $args = array(), $widget_args = array(), $content = '' ) {
55
		if ( $this->is_preview() ) {
56
			return $this->get_dummy_preview( $args );
57
		}
58
59
		return wpinv_payment_receipt();
60
	}
61
62
	public function get_dummy_preview( $args ) {
0 ignored issues
show
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

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

62
	public function get_dummy_preview( /** @scrutinizer ignore-unused */ $args ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
		global $wpdb;
64
65
		$output = aui()->alert( array(
66
				'type'=> 'info',
67
				'content' => __( 'This is a simple preview for a invoice receipt.', 'invoicing' )
68
			)
69
		);
70
71
		if ( ! current_user_can( 'manage_options' ) ) {
72
			return $output;
73
		}
74
75
		$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` = %s AND `post_status` IN( 'wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold' ) ORDER BY `post_status` ASC, `ID` ASC LIMIT 1;", 'wpi_invoice' ) );
76
77
		if ( ! $invoice_id ) {
78
			return $output;
79
		}
80
81
		$invoice = new WPInv_Invoice( $invoice_id );
82
83
		if ( empty( $invoice ) ) {
84
			return $output;
85
		}
86
87
		$output .= wpinv_get_template_html( 'invoice-receipt.php', array( 'invoice' => $invoice ) );
88
89
		$output = preg_replace( '/<a([^>]*)href=(["\'])(.*?)\2([^>]*)>/is', '<a\\1href="javascript:void(0)"\\4>', $output );
90
91
		return $output;
92
	}
93
}
94