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.

meta-boxes/class-getpaid-meta-box-item-info.php (2 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * Item Info
5
 *
6
 * Display the item data meta box.
7
 *
8
 */
9
10
if ( ! defined( 'ABSPATH' ) ) {
11
	exit; // Exit if accessed directly
12
}
13
14
/**
15
 * GetPaid_Meta_Box_Item_Info Class.
16
 */
17
class GetPaid_Meta_Box_Item_Info {
18
19
    /**
20
	 * Output the metabox.
21
	 *
22
	 * @param WP_Post $post
23
	 */
24
    public static function output( $post ) {
25
26
        // Prepare the item.
27
        $item = new WPInv_Item( $post );
28
29
        ?>
30
31
        <div class='bsui' style='padding-top: 10px;'>
32
            <?php do_action( 'wpinv_item_before_info_metabox', $item ); ?>
33
34
            <div class="wpinv_item_type form-group mb-3 row">
35
                <label for="wpinv_item_type" class="col-sm-12 col-form-label">
36
                    <?php esc_html_e( 'Item Type', 'invoicing' ); ?>
37
                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php echo esc_attr( self::get_tooltip( $post ) ); ?>"></span>
38
                </label>
39
40
                <div class="col-sm-12">
41
42
                    <?php
43
                        aui()->select(
44
                            array(
45
                                'id'               => 'wpinv_item_type',
46
                                'name'             => 'wpinv_item_type',
47
                                'placeholder'      => __( 'Select item type', 'invoicing' ),
48
                                'value'            => $item->get_type( 'edit' ),
49
                                'select2'          => true,
50
                                'data-allow-clear' => 'false',
51
                                'no_wrap'          => true,
52
                                'options'          => wpinv_get_item_types(),
53
                            ),
54
                            true
55
                        );
56
                    ?>
57
58
                </div>
59
            </div>
60
61
            <?php if ( getpaid_item_type_supports( $item->get_type( 'edit' ), 'buy_now' ) ) : ?>
62
                <div class="wpinv_item_shortcode form-group mb-3 row">
63
                    <label for="wpinv_item_shortcode" class="col-sm-12 col-form-label">
64
                        <?php esc_html_e( 'Payment Form Shortcode', 'invoicing' ); ?>
65
                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Displays a payment form', 'invoicing' ); ?>"></span>
66
                    </label>
67
68
                    <div class="col-sm-12">
69
                        <input  onClick="this.select()" type="text" id="wpinv_item_shortcode" value="[getpaid item=<?php echo esc_attr( $item->get_id() ); ?>]" style="width: 100%;" readonly/>
70
                    </div>
71
                </div>
72
73
                <div class="wpinv_item_buy_shortcode form-group mb-3 row">
74
                    <label for="wpinv_item_button_shortcode" class="col-sm-12 col-form-label">
75
                        <?php esc_html_e( 'Payment Button Shortcode', 'invoicing' ); ?>
76
                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Displays a buy now button', 'invoicing' ); ?>"></span>
77
                    </label>
78
79
                    <div class="col-sm-12">
80
                        <input onClick="this.select()" type="text" id="wpinv_item_button_shortcode" value="[getpaid item=<?php echo esc_attr( $item->get_id() ); ?> button='Buy Now']" style="width: 100%;" readonly/>
81
                        <small class="form-text text-muted">
82
                            <?php esc_html_e( 'Or use the following URL in a link:', 'invoicing' ); ?>
83
                            <code>#getpaid-item-<?php echo intval( $item->get_id() ); ?>|0</code>
84
                        </small>
85
                    </div>
86
                </div>
87
88
                <div class="wpinv_item_buy_url form-group mb-3 row">
89
                    <label for="wpinv_item_buy_url" class="col-sm-12 col-form-label">
90
                        <?php esc_html_e( 'Direct Payment URL', 'invoicing' ); ?>
91
                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'You can use this in an iFrame to embed the payment form on another website', 'invoicing' ); ?>"></span>
92
                    </label>
93
94
                    <div class="col-sm-12">
95
                        <input onClick="this.select()" type="text" id="wpinv_item_buy_url" value="<?php echo esc_url( getpaid_embed_url( false, $item->get_id() . '|0' ) ); ?>" style="width: 100%;" readonly/>
0 ignored issues
show
false of type false is incompatible with the type integer expected by parameter $payment_form of getpaid_embed_url(). ( Ignorable by Annotation )

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

95
                        <input onClick="this.select()" type="text" id="wpinv_item_buy_url" value="<?php echo esc_url( getpaid_embed_url( /** @scrutinizer ignore-type */ false, $item->get_id() . '|0' ) ); ?>" style="width: 100%;" readonly/>
Loading history...
96
                    </div>
97
                </div>
98
99
            <?php endif; ?>
100
101
            <div class="wpinv_item_custom_id form-group mb-3">
102
                <?php esc_html_e( 'Custom ID', 'invoicing' ); ?> &mdash; <?php echo esc_html( $item->get_custom_id() ); ?>
103
            </div>
104
105
            <?php do_action( 'wpinv_meta_values_metabox_before', $post ); ?>
106
            <?php foreach ( apply_filters( 'wpinv_show_meta_values_for_keys', array() ) as $meta_key ) : ?>
107
                <div class="wpinv_item_custom_id form-group mb-3">
108
                    <?php echo esc_html( $meta_key ); ?> &mdash; <?php echo esc_html( get_post_meta( $item->get_id(), '_wpinv_' . $meta_key, true ) ); ?>
0 ignored issues
show
It seems like get_post_meta($item->get...nv_' . $meta_key, true) can also be of type false; however, parameter $text of esc_html() 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

108
                    <?php echo esc_html( $meta_key ); ?> &mdash; <?php echo esc_html( /** @scrutinizer ignore-type */ get_post_meta( $item->get_id(), '_wpinv_' . $meta_key, true ) ); ?>
Loading history...
109
                </div>
110
            <?php endforeach; ?>
111
            <?php do_action( 'wpinv_meta_values_metabox_after', $post ); ?>
112
            <?php do_action( 'wpinv_item_info_metabox', $item ); ?>
113
        </div>
114
        <?php
115
116
    }
117
118
    /**
119
	 * Returns item type tolltip.
120
	 *
121
	 */
122
    public static function get_tooltip( $post ) {
123
124
        ob_start();
125
        ?>
126
127
        <?php esc_html_e( 'Standard: Standard item type', 'invoicing' ); ?>
128
        <?php esc_html_e( 'Fee: Like Registration Fee, Sign up Fee etc', 'invoicing' ); ?>
129
130
        <?php
131
        do_action( 'wpinv_item_info_metabox_after', $post );
132
133
        return ob_get_clean();
134
135
    }
136
137
}
138