Issues (214)

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.

src/Mmanager.php (2 issues)

Labels
Severity

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
 * m'Manager | Invoices Management System
4
 * 
5
 * This content is released under the Proprietary License (Proprietary)
6
 *
7
 * Copyright (c) 2017, Eric Claver AKAFFOU - All Rights Reserved
8
 * Unauthorized copying of this file, via any medium is strictly prohibited
9
 * Proprietary and confidential
10
 * 
11
 * @package m'Manager
12
 * @author  Eric Claver AKAFFOU
13
 * @copyright   Copyright (c) 2017, on'Eric Computing, Inc. (https://www.onericcomputing.com/)
14
 * @license https://www.mmanager.fr  Proprietary License
15
 * @link    https://codecanyon.net/item/mmanager-invoices-management-system/19866435?s_rank=1
16
 * @since   Version 1.0.0
17
 * @filesource
18
 */
19
20
namespace Mmanager;
21
22
use Mmanager\Domain\Repository\Customer\CustomerRepository;
23
use Mmanager\Domain\Repository\Invoice\InvoiceRepository;
24
use Mmanager\Persistence\Adapter\CodeIgniter\CIQueryBuilder;
25
use Mmanager\Logger\FileLogger;
26
use Mmanager\Logger\FileLoggerFactory;
27
28
class Mmanager
29
{
30
	protected $user_id;
31
32
	public function __construct() {
33
		$this->Customer = new CustomerRepository(new CIQueryBuilder);
0 ignored issues
show
The property Customer does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
34
		$this->Invoice = new InvoiceRepository(new CIQueryBuilder);
0 ignored issues
show
The property Invoice does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
35
		$this->user_id = get_user_id();
36
	}
37
	public function setUserID($user_id = null) {
38
		$this->user_id = isset($user_id) ? $user_id : get_user_id();
39
		return $this;
40
	}
41
	public function getUserID()
42
	{
43
		return $this->user_id;
44
	}
45
	public static function getUrl($request_url) {
46
	  $ch = curl_init();
47
	  curl_setopt($ch, CURLOPT_URL, $request_url);
48
	  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
49
	  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
50
	  $response = curl_exec($ch);
51
	  curl_close($ch);
52
53
	  return $response;
54
	}
55
	public static function isValidLicense() {
56
		$request_url = 'https://www.mmanager.fr/process.php?r=cl&rf='.base_url().'&pc='.get_option('purchase_code');
57
		return self::getUrl($request_url);
58
	}
59
	public static function expire() {
60
	  $validity = self::isValidLicense();
61
	  if ($validity == 1) {
62
		return '<span style="color:green">'. strtoupper(__('label_never')).'</span>';
63
	  } else {
64
		return '<span style="color:red">'.strtoupper(__('message_contact_reseller_support')).'</span>';
65
	  }
66
	}
67
	public static function LicenseDetails() {
68
		return '<p><span><strong>'. __('label_license_details'). '</strong></span><ul><li>'.__('label_domain'). rtrim(base_url(), '/').'</li><li>Status: '. is_valid_license(self::isValidLicense()).'</li><li>Expires: '. self::expire().'</li></ul></em></p>';
69
	}
70
	public static function render($module, $view_file, $data = null, $return = false) {
71
	  return __render($module, $view_file, $data, $return);
72
	}
73
	public static function write_log($log_msg, $folder, $extension)
74
	{
75
		if (!file_exists($folder)) 
76
		{
77
			// create directory.
78
			mkdir($folder, 0777, true);
79
		}
80
		$filePath = $folder.'/log-' . date('Y-m-d') . '.'.$extension;
81
82
		$loggerFactory = new FileLoggerFactory($filePath);
83
		$logger = $loggerFactory->createLogger();
84
85
		$logger->log($log_msg);
86
	}
87
}
88