Issues (1)

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/AuthenticatorWrapper.php (1 issue)

Labels
Severity

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
 * AppserverIo\Psr\Auth\AuthenticatorWrapper
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2016 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io-psr/auth
18
 * @link      http://www.appserver.io
19
 */
20
21
namespace AppserverIo\Psr\Auth;
22
23
use AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface;
24
use AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface;
25
26
/**
27
 * Wrapper for a authentication type implementation.
28
 *
29
 * @author    Tim Wagner <[email protected]>
30
 * @copyright 2016 TechDivision GmbH <[email protected]>
31
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
32
 * @link      https://github.com/appserver-io-psr/auth
33
 * @link      http://www.appserver.io
34
 */
35
class AuthenticatorWrapper implements AuthenticatorInterface
36
{
37
38
    /**
39
     * The authenticator instance to be wrapped.
40
     *
41
     * @var \AppserverIo\Psr\Auth\AuthenticatorInterface
42
     */
43
    protected $authenticator;
44
45
    /**
46
     * Injects the passed authenticator instance into this wrapper.
47
     *
48
     * @param \AppserverIo\Psr\Auth\AuthenticatorInterface $authenticator The authenticator instance used for initialization
49
     *
50
     * @return void
51
     */
52
    public function injectAuthenticator(AuthenticatorInterface $authenticator)
53
    {
54
        $this->authenticator = $authenticator;
55
    }
56
57
    /**
58
     * Return's the authenticator instance.
59
     *
60
     * @return \AppserverIo\Psr\Auth\AuthenticatorInterface The authenticator instance
61
     */
62
    public function getAuthenticator()
63
    {
64
        return $this->authenticator;
65
    }
66
67
    /**
68
     * Returns the configuration data given for authentication type.
69
     *
70
     * @return object The configuration data
71
     */
72
    public function getConfigData()
73
    {
74
        return $this->getAuthenticator()->getConfigData();
75
    }
76
77
    /**
78
     * Return's the authentication manager instance.
79
     *
80
     * @return \AppserverIo\Psr\Auth\AuthenticationManagerInterface The authentication manager instance
81
     */
82
    public function getAuthenticationManager()
83
    {
84
        return $this->getAuthenticator()->getAuthenticationManager();
85
    }
86
87
    /**
88
     * Returns the authentication type token.
89
     *
90
     * @return string The auth type
91
     */
92
    public function getAuthType()
93
    {
94
        return $this->getAuthenticator()->getType();
0 ignored issues
show
The method getType() does not seem to exist on object<AppserverIo\Psr\A...AuthenticatorInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
95
    }
96
97
    /**
98
     * Try to authenticate against the configured adapter.
99
     *
100
     * @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface  $servletRequest  The servlet request instance
101
     * @param \AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse The servlet response instance
102
     *
103
     * @return boolean TRUE if authentication has already been processed on a request before, else FALSE
104
     * @throws \AppserverIo\Http\Authentication\AuthenticationException Is thrown if the request can't be authenticated
105
     */
106
    public function authenticate(HttpServletRequestInterface $servletRequest, HttpServletResponseInterface $servletResponse)
107
    {
108
        return $this->getAuthenticator()->authenticate($servletRequest, $servletResponse);
109
    }
110
111
    /**
112
     * Returns the password parsed from the request.
113
     *
114
     * @return string|null The password
115
     */
116
    public function getPassword()
117
    {
118
        return $this->getAuthenticator()->getPassword();
119
    }
120
121
    /**
122
     * Returns the username parsed from the request.
123
     *
124
     * @return string|null The username
125
     */
126
    public function getUsername()
127
    {
128
        return $this->getAuthenticator()->getUsername();
129
    }
130
131
    /**
132
     * Mark's the authenticator as the default one.
133
     *
134
     * @return void
135
     */
136
    public function setDefaultAuthenticator()
137
    {
138
        $this->getAuthenticator()->setDefaultAuthenticator();
139
    }
140
141
    /**
142
     * Query whether or not this is the default authenticator.
143
     *
144
     * @return boolean TRUE if this is the default authenticator, else FALSE
145
     */
146
    public function isDefaultAuthenticator()
147
    {
148
        return $this->getAuthenticator()->isDefaultAuthenticator();
149
    }
150
}
151