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.

includes/class-wpinv-cli.php (4 issues)

1
<?php
2
/**
3
 * Contains the main CLI class
4
 *
5
 * @since 1.0.13
6
 * @package Invoicing
7
 */
8
9
// MUST have WordPress.
10
if ( ! defined( 'WPINC' ) ) {
11
    exit;
12
}
13
14
/**
15
 * The main class responsible for registering CLI commands
16
 * @since 1.0.13
17
 */
18
class WPInv_CLI {
19
20
    /**
21
     * Creates a new invoice
22
     *
23
     *  @param Array $args Arguments in array format.
24
     *  @param Array $assoc_args Key value arguments stored in associated array format.
25
     *  @since 1.0.13
26
     */
27
    public function insert_invoice( $args, $assoc_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

27
    public function insert_invoice( /** @scrutinizer ignore-unused */ $args, $assoc_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...
28
29
        // Fetch invoice data from the args
30
        $invoice_data = wp_unslash( $assoc_args );
31
32
        // Abort if no invoice data is provided
33
        if ( empty( $invoice_data ) ) {
34
            return WP_CLI::error( __( 'Invoice data not provided', 'invoicing' ) );
0 ignored issues
show
The type WP_CLI was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
35
        }
36
37
        //Cart details
38
        if ( ! empty( $invoice_data['cart_details'] ) ) {
39
            $invoice_data['cart_details'] = json_decode( $invoice_data['cart_details'], true );
40
        }
41
42
        //User details
43
        if ( ! empty( $invoice_data['user_info'] ) ) {
44
            $invoice_data['user_info'] = json_decode( $invoice_data['user_info'], true );
45
        }
46
47
        //Payment info
48
        if ( ! empty( $invoice_data['payment_details'] ) ) {
49
            $invoice_data['payment_details'] = json_decode( $invoice_data['payment_details'], true );
50
        }
51
52
        // Try creating the invoice
53
        $invoice = wpinv_insert_invoice( $invoice_data, true );
54
55
        if ( is_wp_error( $invoice ) ) {
56
            return WP_CLI::error( $invoice->get_error_message() );
0 ignored issues
show
The method get_error_message() does not exist on WPInv_Invoice. ( Ignorable by Annotation )

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

56
            return WP_CLI::error( $invoice->/** @scrutinizer ignore-call */ get_error_message() );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
57
        }
58
59
        $message = sprintf( __( 'Invoice %s created', 'invoicing' ), $invoice->get_id() );
0 ignored issues
show
The method get_id() does not exist on WP_Error. ( Ignorable by Annotation )

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

59
        $message = sprintf( __( 'Invoice %s created', 'invoicing' ), $invoice->/** @scrutinizer ignore-call */ get_id() );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
60
        WP_CLI::success( $message );
61
    }
62
63
64
}
65