Issues (268)

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.

code/control/EmailCallback.php (5 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
class EmailCallback extends SocialIntegrationControllerBaseClass implements SocialIntegrationAPIInterface
0 ignored issues
show
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: get_number_of_friends_that_can_be_retrieved, get_updates, set_number_of_friends_that_can_be_retrieved
Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
6
7
    /**
8
     * make sure to return TRUE as response if the message is sent
9
     * successfully
10
     * Sends a message from the current user to someone else in the networkd
11
     * @param Int | String | Member $to -
12
     * @param String $message - Message you are sending
13
     * @param String $link - Link to send with message - NOT USED IN EMAIL
14
     * @param Array - other variables that we include
15
     * @return Boolean - return TRUE as success
16
     */
17
    public static function send_message($to, $message, $link = "", $otherVariables = array())
18
    {
19
20
        //FROM
21
        if (!empty($otherVariables["From"])) {
22
            $from = $otherVariables["From"];
23
        } else {
24
            $from = Email::getAdminEmail();
25
        }
26
27
        //TO
28
        if ($to instanceof Member) {
29
            $to = $to->Email;
30
        }
31
        //SUBJECT
32 View Code Duplication
        if (!empty($otherVariables["Subject"])) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
            $subject = $otherVariables["Subject"];
34
        } else {
35
            $subject = substr($message, 0, 30);
36
        }
37
38
        //BODY
39
        $body = $message;
40
41
        //CC
42
        if (!empty($otherVariables["CC"])) {
43
            $cc = $otherVariables["CC"];
44
        } else {
45
            $cc = "";
46
        }
47
48
        //BCC
49
        $bcc = Email::getAdminEmail();
50
51
        //SEND EMAIL
52
        $email = new Email(
53
            $from,
54
            $to,
55
            $subject,
56
            $body,
57
            $bounceHandlerURL = null,
58
            $cc,
59
            $bcc
60
        );
61
        return $email->send();
62
    }
63
64
    public static function get_list_of_friends($limit = 12, $searchString = "")
65
    {
66
        return array();
67
    }
68
69
    /**
70
     *
71
     * return Object | Null
72
     */
73
    public static function get_current_user()
74
    {
75
        return Member::currentUser();
76
    }
77
78
    public static function is_valid_user($id)
79
    {
80
        return filter_var($id, FILTER_VALIDATE_EMAIL);
81
    }
82
83
    /**
84
     * Link to login form
85
     * @param String $returnURL
86
     * @return String
87
     */
88
    public static function connect_url($returnURL = "", $existingMember = false)
89
    {
90
        $backURLString = "";
91
        if ($returnURL) {
92
            $backURLString = 'BackURL='.urlencode($returnURL);
93
        }
94
        if ($existingMember) {
95
            $tab = 'EmailLoginForm_LoginForm_tab';
96
        } else {
97
            $tab = "MemberLoginFormWithSignup_LoginForm_tab";
98
        }
99
        //$backLink = urlencode($returnURL);
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
100
        //return "Security/login/".$backLink."#".$tab;
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
101
        return "Security/login/?email=1&amp;".$backURLString."#".$tab;
102
    }
103
104
    public function meondatabase()
105
    {
106
        print_r(Member::currentUser());
107
    }
108
}
109