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/admin/views/html-tax-rates-edit.php (2 issues)

1
<?php
2
/**
3
 * Displays the tax rates table.
4
 *
5
 */
6
7
defined( 'ABSPATH' ) || exit;
8
9
$tax_rates  = GetPaid_Tax::get_all_tax_rates();
10
$dummy_rate = array(
11
    'country'      => '',
12
    'state'        => '',
13
    'global'       => true,
14
    'rate'         => wpinv_get_default_tax_rate(),
15
    'reduced_rate' => 5,
16
    'name'         => __( 'VAT', 'invoicing' ),
17
);
18
19
$reset_url = wp_nonce_url(
20
    add_query_arg( 'getpaid-admin-action', 'reset_tax_rates' ),
21
    'getpaid-nonce',
22
    'getpaid-nonce'
23
);
24
25
?>
26
<div class="table-responsive">
27
    <table id="wpinv_tax_rates" class="widefat fixed table">
28
        <caption><?php echo esc_html_e( 'Enter tax rates for specific regions.', 'invoicing' ); ?></caption>
0 ignored issues
show
Are you sure the usage of esc_html_e('Enter tax ra...regions.', 'invoicing') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
29
30
        <thead>
31
            <tr class="table-light">
32
33
                <th scope="col" class="border-bottom border-top">
34
                    <?php esc_html_e( 'Country', 'invoicing' ); ?>
35
                    <?php getpaid_get_help_tip( __( 'Optionally limit this tax rate to a specific country.', 'invoicing' ), 'position-static', true ); ?>
36
                </th>
37
38
                <th scope="col" class="border-bottom border-top">
39
                    <?php esc_html_e( 'State', 'invoicing' ); ?>
40
                    <?php getpaid_get_help_tip( __( 'Separate state codes using a comma or leave blank to apply country wide.', 'invoicing' ), 'position-static', true ); ?>
41
                </th>
42
43
                <th scope="col" class="border-bottom border-top">
44
                    <?php esc_html_e( 'Standard Rate %', 'invoicing' ); ?>
45
                    <?php getpaid_get_help_tip( __( 'The tax rate (percentage) to charge on items that use the "Standard rate" tax class.', 'invoicing' ), 'position-static', true ); ?>
46
                </th>
47
48
                <th scope="col" class="border-bottom border-top">
49
                    <?php esc_html_e( 'Reduced Rate %', 'invoicing' ); ?>
50
                    <?php getpaid_get_help_tip( __( 'The tax rate (percentage) to charge on items that use the "Reduced rate" tax class.', 'invoicing' ), 'position-static', true ); ?>
51
                </th>
52
53
                <th scope="col" class="border-bottom border-top">
54
                    <?php esc_html_e( 'Tax Name', 'invoicing' ); ?>
55
                    <?php getpaid_get_help_tip( __( 'The name of this tax, e.g VAT.', 'invoicing' ), 'position-static', true ); ?>
56
                </th>
57
58
                <th scope="col" class="border-bottom border-top" style="width:32px">&nbsp;</th>
59
60
            </tr>
61
        </thead>
62
63
        <tbody>
64
            <?php array_walk( $tax_rates, 'wpinv_tax_rate_callback' ); ?>
65
        </tbody>
66
67
        <tfoot>
68
            <tr class="table-light">
69
                <td colspan="6" class="border-top">
70
71
                    <button type="button" class="button button-secondary wpinv_add_tax_rate" aria-label="<?php esc_attr_e( 'Add Tax Rate', 'invoicing' ); ?>">
72
                        <span><?php esc_html_e( 'Add Tax Rate', 'invoicing' ); ?></span>
73
                    </button>
74
75
                    <a href="<?php echo esc_url( $reset_url ); ?>" class="button button-secondary wpinv_reset_tax_rates" aria-label="<?php esc_attr_e( 'Reset Tax Rates', 'invoicing' ); ?>">
76
                        <span><?php esc_html_e( 'Reset Tax Rates', 'invoicing' ); ?></span>
77
                    </a>
78
                </td>
79
            </tr>
80
        </tfoot>
81
    </table>
82
</div>
83
84
<script type="text/html" id="tmpl-wpinv-tax-rate-row">
85
    <?php wpinv_tax_rate_callback( $dummy_rate, 0, true ); ?>
0 ignored issues
show
The call to wpinv_tax_rate_callback() has too many arguments starting with true. ( Ignorable by Annotation )

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

85
    <?php /** @scrutinizer ignore-call */ wpinv_tax_rate_callback( $dummy_rate, 0, true ); ?>

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
86
</script>
87
88