Issues (632)

Security Analysis    not enabled

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

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

Apps/Model/Admin/Feedback/FormAnswerAdd.php (2 issues)

1
<?php
2
3
namespace Apps\Model\Admin\Feedback;
4
5
use Apps\ActiveRecord\FeedbackAnswer;
6
use Apps\Model\Front\Feedback\FormAnswerAdd as FrontAnswer;
7
use Apps\Model\Front\Profile\EntityAddNotification;
8
use Ffcms\Core\App;
9
use Ffcms\Core\Helper\Text;
10
11
/**
12
 * Class FormAnswerAdd. Extend front model add answer
13
 * @package Apps\Model\Admin\Feedback
14
 */
15
class FormAnswerAdd extends FrontAnswer
16
{
17
    /**
18
     * @inheritdoc
19
     */
20
    public function make()
21
    {
22
        // update readed marker
23
        $this->_post->readed = 1;
0 ignored issues
show
Documentation Bug introduced by
The property $readed was declared of type boolean, but 1 is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
24
        $this->_post->save();
25
26
        // add new answer row in database
27
        $record = new FeedbackAnswer();
28
        $record->feedback_id = $this->_post->id;
29
        $record->name = $this->name;
30
        $record->email = $this->email;
31
        $record->message = $this->message;
32
        $record->user_id = $this->_userId;
33
        $record->is_admin = 1;
0 ignored issues
show
Documentation Bug introduced by
The property $is_admin was declared of type boolean, but 1 is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
34
35
        $record->ip = $this->_ip;
36
        $record->save();
37
38
        // add user notification
39
        if ((int)$this->_post->user_id > 0 && $this->_userId !== (int)$this->_post->user_id) {
40
            $notify = new EntityAddNotification((int)$this->_post->user_id);
41
            $uri = '/feedback/read/' . $this->_post->id . '/' . $this->_post->hash . '#feedback-answer-' . $record->id;
42
43
            $notify->add($uri, EntityAddNotification::MSG_ADD_FEEDBACKANSWER, [
44
                'snippet' => Text::snippet($this->message, 50),
45
                'post' => Text::snippet($this->_post->message, 50)
46
            ]);
47
        }
48
        if (App::$Mailer) {
49
            // send email notification
50
            App::$Mailer->tpl('feedback/mail/newanswer', [
51
                'record' => $record
52
            ])->send($record->email, App::$Translate->get('Feedback', 'New answer in request #%id%', ['id' => $record->id]));
53
        }
54
55
        // unset message data
56
        $this->message = null;
57
    }
58
}
59