GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (1361)

Security Analysis    not enabled

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

  Cross-Site Scripting
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
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
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.

htmlpurifier/library/HTMLPurifier/AttrDef.php (2 issues)

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
3
/**
4
 * Base class for all validating attribute definitions.
5
 *
6
 * This family of classes forms the core for not only HTML attribute validation,
7
 * but also any sort of string that needs to be validated or cleaned (which
8
 * means CSS properties and composite definitions are defined here too).
9
 * Besides defining (through code) what precisely makes the string valid,
10
 * subclasses are also responsible for cleaning the code if possible.
11
 */
12
13
abstract class HTMLPurifier_AttrDef
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
14
{
15
16
    /**
17
     * Tells us whether or not an HTML attribute is minimized.
18
     * Has no meaning in other contexts.
19
     * @type bool
20
     */
21
    public $minimized = false;
22
23
    /**
24
     * Tells us whether or not an HTML attribute is required.
25
     * Has no meaning in other contexts
26
     * @type bool
27
     */
28
    public $required = false;
29
30
    /**
31
     * Validates and cleans passed string according to a definition.
32
     *
33
     * @param string $string String to be validated and cleaned.
34
     * @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object.
35
     * @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object.
36
     */
37
    abstract public function validate($string, $config, $context);
38
39
    /**
40
     * Convenience method that parses a string as if it were CDATA.
41
     *
42
     * This method process a string in the manner specified at
43
     * <http://www.w3.org/TR/html4/types.html#h-6.2> by removing
44
     * leading and trailing whitespace, ignoring line feeds, and replacing
45
     * carriage returns and tabs with spaces.  While most useful for HTML
46
     * attributes specified as CDATA, it can also be applied to most CSS
47
     * values.
48
     *
49
     * @note This method is not entirely standards compliant, as trim() removes
50
     *       more types of whitespace than specified in the spec. In practice,
51
     *       this is rarely a problem, as those extra characters usually have
52
     *       already been removed by HTMLPurifier_Encoder.
53
     *
54
     * @warning This processing is inconsistent with XML's whitespace handling
55
     *          as specified by section 3.3.3 and referenced XHTML 1.0 section
56
     *          4.7.  However, note that we are NOT necessarily
57
     *          parsing XML, thus, this behavior may still be correct. We
58
     *          assume that newlines have been normalized.
59
     */
60
    public function parseCDATA($string)
61
    {
62
        $string = trim($string);
63
        $string = str_replace(array("\n", "\t", "\r"), ' ', $string);
64
        return $string;
65
    }
66
67
    /**
68
     * Factory method for creating this class from a string.
69
     * @param string $string String construction info
70
     * @return HTMLPurifier_AttrDef Created AttrDef object corresponding to $string
71
     */
72
    public function make($string)
73
    {
74
        // default implementation, return a flyweight of this object.
75
        // If $string has an effect on the returned object (i.e. you
76
        // need to overload this method), it is best
77
        // to clone or instantiate new copies. (Instantiation is safer.)
78
        return $this;
79
    }
80
81
    /**
82
     * Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work
83
     * properly. THIS IS A HACK!
84
     * @param string $string a CSS colour definition
85
     * @return string
86
     */
87
    protected function mungeRgb($string)
88
    {
89
        return preg_replace('/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\)/', 'rgb(\1,\2,\3)', $string);
90
    }
91
92
    /**
93
     * Parses a possibly escaped CSS string and returns the "pure"
94
     * version of it.
95
     */
96
    protected function expandCSSEscape($string)
97
    {
98
        // flexibly parse it
99
        $ret = '';
100
        for ($i = 0, $c = strlen($string); $i < $c; $i++) {
0 ignored issues
show
Comprehensibility Bug introduced by
Loop incrementor ($i) jumbling with inner loop
Loading history...
101
            if ($string[$i] === '\\') {
102
                $i++;
103
                if ($i >= $c) {
104
                    $ret .= '\\';
105
                    break;
106
                }
107
                if (ctype_xdigit($string[$i])) {
108
                    $code = $string[$i];
109
                    for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) {
110
                        if (!ctype_xdigit($string[$i])) {
111
                            break;
112
                        }
113
                        $code .= $string[$i];
114
                    }
115
                    // We have to be extremely careful when adding
116
                    // new characters, to make sure we're not breaking
117
                    // the encoding.
118
                    $char = HTMLPurifier_Encoder::unichr(hexdec($code));
119
                    if (HTMLPurifier_Encoder::cleanUTF8($char) === '') {
120
                        continue;
121
                    }
122
                    $ret .= $char;
123
                    if ($i < $c && trim($string[$i]) !== '') {
124
                        $i--;
125
                    }
126
                    continue;
127
                }
128
                if ($string[$i] === "\n") {
129
                    continue;
130
                }
131
            }
132
            $ret .= $string[$i];
133
        }
134
        return $ret;
135
    }
136
}
137
138
// vim: et sw=4 sts=4
139