Issues (1066)

Security Analysis    7 potential vulnerabilities

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection (3)
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection (3)
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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

src/Dom/DOMEvent.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace PhpQuery\Dom;
3
4
/**
5
 * DOMEvent class.
6
 *
7
 * Based on
8
 * @link    http://developer.mozilla.org/En/DOM:event
9
 * @author  Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
10
 * @package PhpQuery
11
 * @todo    implement ArrayAccess ?
12
 */
13
class DOMEvent
14
{
15
    /**
16
     * Returns a boolean indicating whether the event bubbles up through the DOM or not.
17
     *
18
     * @var bool
19
     */
20
    public $bubbles = true;
21
    /**
22
     * Returns a boolean indicating whether the event is cancelable.
23
     *
24
     * @var bool
25
     */
26
    public $cancelable = true;
27
    /**
28
     * Returns a reference to the currently registered target for the event.
29
     *
30
     * @var bool
31
     */
32
    public $currentTarget;
33
    /**
34
     * Returns detail about the event, depending on the type of event.
35
     *
36
     * @var string
37
     * @link http://developer.mozilla.org/en/DOM/event.detail
38
     */
39
    public $detail; // ???
40
    /**
41
     * Used to indicate which phase of the event flow is currently being evaluated.
42
     *
43
     * NOT IMPLEMENTED
44
     *
45
     * @var string
46
     * @link http://developer.mozilla.org/en/DOM/event.eventPhase
47
     */
48
    public $eventPhase; // ???
49
    /**
50
     * The explicit original target of the event (Mozilla-specific).
51
     *
52
     * NOT IMPLEMENTED
53
     *
54
     * @var string
55
     */
56
    public $explicitOriginalTarget; // moz only
57
    /**
58
     * The original target of the event, before any retargetings (Mozilla-specific).
59
     *
60
     * NOT IMPLEMENTED
61
     *
62
     * @var string
63
     */
64
    public $originalTarget; // moz only
65
    /**
66
     * Identifies a secondary target for the event.
67
     *
68
     * @var string
69
     */
70
    public $relatedTarget;
71
    /**
72
     * Returns a reference to the target to which the event was originally dispatched.
73
     *
74
     * @var string
75
     */
76
    public $target;
77
    /**
78
     * Returns the time that the event was created.
79
     *
80
     * @var string
81
     */
82
    public $timeStamp;
83
    /**
84
     * Returns the name of the event (case-insensitive).
85
     */
86
    public $type;
87
    public $runDefault = true;
88
    public $data = null;
89
90
    public function __construct($data)
91
    {
92
        foreach ($data as $k => $v) {
93
            $this->$k = $v;
94
        }
95
        if (!$this->timeStamp) {
96
            $this->timeStamp = time();
0 ignored issues
show
Documentation Bug introduced by
The property $timeStamp was declared of type string, but time() is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
97
        }
98
    }
99
100
    /**
101
     * Cancels the event (if it is cancelable).
102
     *
103
     */
104
    public function preventDefault()
105
    {
106
        $this->runDefault = false;
107
    }
108
109
    /**
110
     * Stops the propagation of events further along in the DOM.
111
     *
112
     */
113
    public function stopPropagation()
114
    {
115
        $this->bubbles = false;
116
    }
117
}
118