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/Front/Profile/EntityAddNotification.php (1 issue)

1
<?php
2
3
namespace Apps\Model\Front\Profile;
4
5
use Apps\ActiveRecord\UserNotification;
6
use Ffcms\Core\Arch\Model;
7
8
/**
9
 * Class EntityAddNotification. Add user notification in database table
10
 * @package Apps\Model\Front\Profile
11
 */
12
class EntityAddNotification extends Model
13
{
14
    const MSG_DEFAULT = 'New notification event: &laquo;%snippet%&raquo;';
15
    const MSG_ADD_WALLPOST = 'New post on the wall: &laquo;%snippet%&raquo;';
16
    const MSG_ADD_WALLANSWER = 'New answer &laquo;%snippet%&raquo; for wall post &laquo;%post%&raquo;';
17
    const MSG_ADD_COMMENTANSWER = 'New answer &laquo;%snippet%&raquo; to your comment &laquo;%post%&raquo;';
18
    const MSG_ADD_FEEDBACKANSWER = 'New answer &laquo;%snippet%&raquo; to your feedback request &laquo;%post%&raquo;';
19
    
20
    private $_targetId;
21
22
    /**
23
     * EntityAddNotification constructor. Pass target user_id inside the model
24
     * @param bool $targetId
25
     */
26
    public function __construct($targetId)
27
    {
28
        $this->_targetId = $targetId;
29
        parent::__construct();
30
    }
31
32
    /**
33
     * Add notification for user
34
     * @param string $uri
35
     * @param string $msg
36
     * @param array|null $vars
37
     */
38
    public function add($uri, $msg = self::MSG_DEFAULT, array $vars = null)
39
    {
40
        // save data into database
41
        $record = new UserNotification();
42
        $record->user_id = $this->_targetId;
0 ignored issues
show
Documentation Bug introduced by
The property $user_id was declared of type integer, but $this->_targetId is of type boolean. 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...
43
        $record->uri = $uri;
44
        $record->msg = $msg;
45
        if ($vars !== null) {
46
            $record->vars = $vars;
47
        }
48
49
        $record->save();
50
    }
51
}
52