Issues (2473)

Branch: master

Security Analysis    no vulnerabilities found

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.

mod/gc_newsfeed/start.php (1 issue)

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
/**
4
 * Newsfeed start.php
5
 *
6
 *
7
 * @version 1.0
8
 * @author Nick Pietrantonio    github.com/piet0024
9
 */
10
11
12
elgg_register_event_handler('init','system', 'newsfeed_init');
13
elgg_register_plugin_hook_handler('index', 'system', 'new_index');
14
15
function newsfeed_init(){
16
    //set up metadata for user's landing page preference
17 View Code Duplication
    if(elgg_is_logged_in()){
18
        $user = elgg_get_logged_in_user_entity();
19
        if(!isset($user->landingpage)){
20
            $user->landingpage = 'news';
21
        }
22
    }
23
24
    //Register newsfeed page handler
25
    elgg_register_page_handler('newsfeed', 'newsfeed_page_handler');
26
27
    if(elgg_is_logged_in()){//for my the my groups widget on the home page
28
        $newsfeed_title = elgg_echo('newsfeed:title');
29
    }else{
30
        $newsfeed_title = elgg_echo('newsfeed:titlenolog');
31
    }
32
33
    //Register the custom index widget for the newsfeed page
34
    elgg_register_widget_type('newsfeed', $newsfeed_title, 'Group and Friend Activity', array('custom_index_widgets'),false);
35
    //Unregister old widget so it doesn't double up in the database on prod
36
    elgg_unregister_widget_type('wet_activity');
37
38
    //Register the site menu link
39
    elgg_register_menu_item('site', array(
40
        'name'=>'newsfeed',
41
        'href'=>elgg_get_site_url().'newsfeed',
42
        'text'=>elgg_echo("newsfeed:menu"),
43
        ));
44
45
    //Register newsfeed filter form
46
    elgg_register_ajax_view("ajax/newsfeed_filter");
47
    elgg_register_action("newsfeed/filter", elgg_get_plugins_path() . "/gc_newsfeed/actions/newsfeed/filter.php");
48
    elgg_register_action('newsfeed/news_toggle', elgg_get_plugins_path(). 'gc_newsfeed/actions/newsfeed/news_toggle.php');
49
    elgg_extend_view('widgets/stream_newsfeed_index/content', 'newsfeed/filter', 450);
50
    elgg_extend_view('widgets/newsfeed/content', 'newsfeed/filter', 450);
51
}
52
53
//Custom Newsfeed Page
54
function newsfeed_page_handler(){
55
    @include (dirname ( __FILE__ ) . "/pages/newsfeed.php");
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
56
    return true;
57
}
58
59
/*
60
 *  Set new index page to sort user's landing page preference
61
 */
62
63
function new_index() {
64
    return !include_once(dirname(__FILE__) . "/pages/index.php");
65
}
66