Issues (22)

Security Analysis    no request data  

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.

src/Adapters/Lcobucci/ValidationData.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
 * @copyright Copyright (c) 2016 Canis.io
4
 * @license   MIT
5
 * @license   http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
6
 */
7
namespace Canis\Lumen\Jwt\Adapters\Lcobucci;
8
9
/**
10
 * Class that wraps validation values
11
 * Jacob added the ability to override just the expiration validator
12
 *
13
 * @author Luís Otávio Cobucci Oblonczyk <[email protected]>
14
 * @author Jacob Morrison <[email protected]>
15
 */
16
class ValidationData 
17
    extends \Lcobucci\JWT\ValidationData
0 ignored issues
show
The extends keyword must be on the same line as the class name
Loading history...
18
{
19
    /**
20
     * The list of things to be validated
21
     *
22
     * @var array
23
     */
24
    private $items;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
25
26
    /**
27
     * Initializes the object
28
     *
29
     * @param int $currentTime
30
     */
31 25
    public function __construct($currentTime = null)
32
    {
33 25
        $currentTime = $currentTime ?: time();
34
35 25
        $this->items = [
36 25
            'jti' => null,
37 25
            'iss' => null,
38 25
            'aud' => null,
39 25
            'sub' => null,
40 25
            'iat' => $currentTime,
41 25
            'nbf' => $currentTime,
42
            'exp' => $currentTime
43 25
        ];
44 25
    }
45
46
    /**
47
     * Configures the id
48
     *
49
     * @param string $id
50
     */
51 1
    public function setId($id)
52
    {
53 1
        $this->items['jti'] = (string) $id;
54 1
    }
55
56
    /**
57
     * Configures the issuer
58
     *
59
     * @param string $issuer
60
     */
61 18
    public function setIssuer($issuer)
62
    {
63 18
        $this->items['iss'] = (string) $issuer;
64 18
    }
65
66
    /**
67
     * Configures the audience
68
     *
69
     * @param string $audience
70
     */
71 2
    public function setAudience($audience)
72
    {
73 2
        $this->items['aud'] = (string) $audience;
74 2
    }
75
76
    /**
77
     * Configures the subject
78
     *
79
     * @param string $subject
80
     */
81 1
    public function setSubject($subject)
82
    {
83 1
        $this->items['sub'] = (string) $subject;
84 1
    }
85
86
    /**
87
     * Configures the time that "iat", "nbf" and "exp" should be based on
88
     *
89
     * @param int $currentTime
90
     */
91 1
    public function setCurrentTime($currentTime)
92
    {
93 1
        $this->items['iat'] = (int) $currentTime;
94 1
        $this->items['nbf'] = (int) $currentTime;
95 1
        $this->items['exp'] = (int) $currentTime;
96 1
    }
97
98
    /**
99
     * Configures the time that "exp" should be based on
100
     *
101
     * @param int $currentTime
102
     */
103 8
    public function setExpiration($currentTime)
104
    {
105 8
        $this->items['exp'] = (int) $currentTime;
106 8
    }
107
108
    /**
109
     * Returns the requested item
110
     *
111
     * @param string $name
112
     *
113
     * @return mixed
114
     */
115 24
    public function get($name)
116
    {
117 24
        return isset($this->items[$name]) ? $this->items[$name] : null;
118
    }
119
120
    /**
121
     * Returns if the item is present
122
     *
123
     * @param string $name
124
     *
125
     * @return boolean
126
     */
127 18
    public function has($name)
128
    {
129 18
        return !empty($this->items[$name]);
130
    }
131
}