Issues (3098)

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.

tests/AllTests.php (1 issue)

Labels

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
//require 'PHPUnit/Autoload.php';
3
4
require __DIR__ . '/bootstrap.php';
5
6
if (!defined('PHPUnit_MAIN_METHOD')) {
7
    define('PHPUnit_MAIN_METHOD', 'KochTest\AllTests::main');
8
}
9
10
class AllTests
11
{
12
    public static function main()
13
    {
14
        PHPUnit_TextUI_TestRunner::run(self::suite());
15
    }
16
17
    public static function suite()
18
    {
19
        $suite = new PHPUnit_Framework_TestSuite('Koch Framework - TestSuite');
20
        foreach (self::getTestFiles() as $file) {
21
            $suite->addFile$file);
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_VARIABLE
Loading history...
22
        }
23
24
        return $suite;
25
    }
26
27
    /**
28
     * Tries to find in CLI parameters and returns array of files to be runj by PHPUnit
29
     * or throws Exception if no such parameter found or directory/file does not exist.
30
     *
31
     * @return array an array of files to be run by PHPUnit
32
     */
33
    private static function getTestFiles()
34
    {
35
        $argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
36
        $run = null;
37
        foreach ($argv as $arg) {
38
            if (preg_match("/^\"?" . self::RUN . "(.+?)\"?$/", $arg, $sub)) {
39
                $run = $sub[1];
40
                break;
41
            }
42
        }
43
        if ($run === null) {
44
            throw new Exception("No argument to run found.");
45
        }
46
        if (is_dir($run)) {
47
            return self::rglob("*[Tt]est.php", $run . DIRECTORY_SEPARATOR);
48
        } elseif (is_file($run)) {
49
            return array($run);
50
        }
51
        throw new Exception(sprintf("Argument '%s' neither file nor directory.", $run));
52
    }
53
54
    /**
55
     * Recursive glob().
56
     *
57
     * @param  string $pattern the pattern passed to glob(), default is "*"
58
     * @param  string $path    the path to scan, default is
59
     * @param  int    $flags   the flags passed to glob()
60
     * @return array  an array of files in the given path matching the pattern.
61
     */
62
    private static function rglob($pattern = '*', $path = '', $flags = 0)
63
    {
64
        $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT) or array();
65
        $files = glob($path . $pattern, $flags) or array();
66
        foreach ($paths as $path) {
67
            $files +=  self::rglob($pattern, $path, $flags);
68
        }
69
70
        return $files;
71
    }
72
}
73
74
if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
75
    AllTests::main();
76
}
77