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 (164)

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.

Controller/Annotations/RouteAnnotationHandler.php (2 issues)

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
namespace PhpBoot\Controller\Annotations;
4
5
use FastRoute\RouteParser\Std;
6
use PhpBoot\Controller\ControllerContainer;
7
use PhpBoot\Controller\ExceptionHandler;
8
use PhpBoot\Entity\ContainerFactory;
9
use PhpBoot\Entity\EntityContainerBuilder;
10
use PhpBoot\Metas\ReturnMeta;
11
use PhpBoot\Annotation\AnnotationBlock;
12
use PhpBoot\Annotation\AnnotationTag;
13
use PhpBoot\Controller\RequestHandler;
14
use PhpBoot\Controller\ResponseHandler;
15
use PhpBoot\Controller\Route;
16
use PhpBoot\Entity\MixedTypeContainer;
17
use PhpBoot\Exceptions\AnnotationSyntaxException;
18
use PhpBoot\Metas\ParamMeta;
19
use PhpBoot\Utils\AnnotationParams;
20
21
class RouteAnnotationHandler
22
{
23
    /**
24
     * @param ControllerContainer $container
25
     * @param AnnotationBlock|AnnotationTag $ann
26
     * @param EntityContainerBuilder $entityBuilder
27
     */
28 4
    public function __invoke(ControllerContainer $container, $ann, EntityContainerBuilder $entityBuilder)
29
    {
30 4
        $params = new AnnotationParams($ann->description, 3);
31 4
        $params->count()>=2 or \PhpBoot\abort(new AnnotationSyntaxException("The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()}::{$ann->parent->name} require 2 params, {$params->count()} given"));
32
33
        //TODO 错误判断: METHOD不支持, path不规范等
34 4
        $httpMethod = strtoupper($params->getParam(0));
35 4
        $target = $ann->parent->name;
36 4
        in_array($httpMethod, [
37 4
            'GET',
38 4
            'POST',
39 4
            'PUT',
40 4
            'HEAD',
41 4
            'PATCH',
42 4
            'OPTIONS',
43
            'DELETE'
44 4
        ]) or \PhpBoot\abort(new AnnotationSyntaxException("unknown method http $httpMethod in {$container->getClassName()}::$target"));
45
        //获取方法参数信息
46 4
        $rfl =  new \ReflectionClass($container->getClassName());
47 4
        $method = $rfl->getMethod($target);
48 4
        $methodParams = $method->getParameters();
49
50 4
        $uri = $params->getParam(1);
51 4
        $uri = rtrim($container->getUriPrefix(), '/').'/'.ltrim($uri, '/');
52 4
        $requestHandler = new RequestHandler();
53 4
        $responseHandler = new ResponseHandler();
54 4
        $exceptionHandler = new ExceptionHandler();
55
56 4
        $route = new Route(
57 4
            $httpMethod,
58 4
            $uri,
59 4
            $requestHandler,
60 4
            $responseHandler,
61 4
            $exceptionHandler,
62 4
            [],
63 4
            $ann->parent->summary,
64 4
            $ann->parent->description
65 4
        );
66
67
        //从路由中获取变量, 用于判断参数是来自路由还是请求
68 4
        $routeParser = new Std();
69 4
        $uri = $params->getParam(1);
70 4
        $info = $routeParser->parse($uri); //0.4和1.0返回值不同, 不兼容
71 4
        if(isset($info[0])){
72 4
            foreach ($info[0] as $i){
73 4
                if(is_array($i)) {
74 3
                    $route->addPathParam($i[0]);
75 3
                }
76 4
            }
77 4
        }
78
79 4
        $hasRefParam = false;
80
        //设置参数列表
81 4
        $paramsMeta = [];
82 4
        foreach ($methodParams as $param){
83 3
            $paramName = $param->getName();
0 ignored issues
show
Consider using $param->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
84 3
            $source = "request.$paramName";
85 3
            if($route->hasPathParam($paramName)){ //参数来自路由
86 3
                $source = "request.$paramName";
87 3
            }elseif($httpMethod == 'GET'){
88 3
                $source = "request.$paramName"; //GET请求显示指定来自query string
89 3
            }
90 3
            $paramClass = $param->getClass();
91 3
            if($paramClass){
92
                $paramClass = $paramClass->getName();
0 ignored issues
show
Consider using $paramClass->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
93
            }
94 3
            $entityContainer = ContainerFactory::create($entityBuilder, $paramClass);
95 3
            $meta = new ParamMeta($paramName,
96 3
                $source,
97 3
                $paramClass?:'mixed',
98 3
                $param->isOptional(),
99 3
                $param->isOptional()?$param->getDefaultValue():null,
100 3
                $param->isPassedByReference(),
101 3
                null,
102 3
                '',
103
                $entityContainer
104 3
            );
105 3
            $paramsMeta[] = $meta;
106 3
            if($meta->isPassedByReference){
107 3
                $hasRefParam = true;
108 3
                $responseHandler->setMapping('response.content.'.$meta->name, new ReturnMeta(
109 3
                    'params.'.$meta->name,
110 3
                    $meta->type, $meta->description,
111 3
                    ContainerFactory::create($entityBuilder, $meta->type)
112 3
                ));
113 3
            }
114 4
        }
115
116 4
        $requestHandler->setParamMetas($paramsMeta);
117 4
        if(!$hasRefParam){
118 3
            $responseHandler->setMapping('response.content', new ReturnMeta('return','mixed','', new MixedTypeContainer()));
119 3
        }else{
120
            //当存在引用参数作为输出时, 默认将 return 数据绑定的到 data 下, 以防止和引用参数作为输出重叠
121 3
            $responseHandler->setMapping($this->returnTarget, new ReturnMeta('return','mixed','', new MixedTypeContainer()));
122
        }
123
124
125 4
        $container->addRoute($target, $route);
126 4
    }
127
128
    public $returnTarget='response.content.data';
129
}