Issues (4)

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.

Controller/TutorialController.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
namespace SumoCoders\FrameworkExampleBundle\Controller;
4
5
use Knp\Menu\MenuItem;
6
use SumoCoders\FrameworkExampleBundle\Form\Type\ButtonIconType;
7
use SumoCoders\FrameworkExampleBundle\Form\Type\CollectionsType;
8
use SumoCoders\FrameworkExampleBundle\Form\Type\DatePickerType;
9
use SumoCoders\FrameworkExampleBundle\Form\Type\FieldsetType;
10
use SumoCoders\FrameworkExampleBundle\Form\Type\LabelsType;
11
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
12
use Symfony\Component\HttpFoundation\Request;
13
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
14
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
15
16
class TutorialController extends Controller
17
{
18
    /**
19
     * @Route("/tutorial/datepicker")
20
     * @Template()
21
     * @return array
22
     */
23
    public function datePickerAction()
24
    {
25
        $form = $this->createForm(DatePickerType::class);
26
27
        return array(
28
            'form' => $form->createView(),
29
        );
30
    }
31
32
    /**
33
     * @Route("/tutorial/labels")
34
     * @Template()
35
     */
36
    public function labelsAction()
37
    {
38
        $form = $this->createForm(LabelsType::class);
39
40
        return array(
41
            'form' => $form->createView(),
42
        );
43
    }
44
45
    /**
46
     * @Route("/tutorial/button-icons")
47
     * @Template()
48
     */
49
    public function buttonIconsAction()
50
    {
51
        $form = $this->createForm(ButtonIconType::class);
52
53
        return array(
54
            'form' => $form->createView(),
55
        );
56
    }
57
58
    /**
59
     * @Route("/tutorial/fieldset")
60
     * @Template()
61
     */
62
    public function fieldsetAction()
63
    {
64
        $form = $this->createForm(FieldsetType::class);
65
66
        return array(
67
            'form' => $form->createView(),
68
        );
69
    }
70
71
    /**
72
     * @Route("/tutorial/statistics")
73
     * @Template()
74
     */
75
    public function statisticsAction()
76
    {
77
        return array();
78
    }
79
80
    /**
81
     * @Route("/tutorial/custom-bread-crumb")
82
     * @Template()
83
     */
84
    public function customBreadCrumbAction(Request $request)
0 ignored issues
show
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
85
    {
86
        /** @var /SumoCoders\FrameworkCoreBundle\BreadCrumb\BreadCrumbBuilder $breadCrumbBuilder */
0 ignored issues
show
The doc-type /SumoCoders\FrameworkCor...Crumb\BreadCrumbBuilder could not be parsed: Unknown type name "/SumoCoders\FrameworkCoreBundle\BreadCrumb\BreadCrumbBuilder" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
87
        $breadCrumbBuilder = $this->get('framework.breadcrumb_builder');
88
        $factory = $this->get('knp_menu.factory');
89
90
        $breadCrumbBuilder->dontExtractFromTheRequest();
91
        $item = (new MenuItem('foo.bar', $factory))
92
            ->setlabel('First!')
93
            ->setUri(
94
                $this->generateUrl('sumocoders_frameworkexample_tutorial_custombreadcrumb') . '#first'
95
            );
96
97
        $breadCrumbBuilder->addItem($item);
98
        $breadCrumbBuilder->addSimpleItem('Second');
99
        $breadCrumbBuilder->addSimpleItem(
100
            'Third',
101
            $this->generateUrl('sumocoders_frameworkexample_tutorial_custombreadcrumb') . '#third'
102
        );
103
104
        return array();
105
    }
106
107
    /**
108
     * @Route("/tutorial/collections")
109
     * @Template()
110
     * @return array
111
     */
112
    public function collectionsAction()
113
    {
114
        $form = $this->createForm(CollectionsType::class);
115
116
        return array(
117
            'form' => $form->createView(),
118
        );
119
    }
120
121
    /**
122
     * @Route("/tutorial/send-mail")
123
     * @Template()
124
     * @param Request $request
125
     * @return array
126
     */
127
    public function sendMailAction(Request $request)
128
    {
129
        $form = $this->createFormBuilder()
130
            ->getForm();
131
132
        $form->handleRequest($request);
133
134
        if ($form->isSubmitted() && $form->isValid()) {
135
            // get the message factory so we can create messages
136
            $messageFactory = $this->get('framework.message_factory');
137
138
            // create a simple message
139
            $message = $messageFactory->createHtmlMessage(
140
                'the subject',
141
                '<p>foo bar</p>'
142
            );
143
144
            // set some extra properties, just like you would do with a normal \Swift_Message
145
            $message->setTo(
146
                $this->getParameter('mailer.default_to_email')
147
            );
148
149
            // send it
150
            $this->get('mailer')->send($message);
151
        }
152
153
        return array(
154
            'form' => $form->createView(),
155
        );
156
    }
157
}
158