Skip to content

Code Security Report: 63 high severity findings, 189 total findings #2

@dev-mend-for-github-com

Description

@dev-mend-for-github-com

Code Security Report

Scan Metadata

Latest Scan: 2024-07-22 05:04pm
Total Findings: 189 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 17809
Detected Programming Languages: 3 (PHP, JavaScript / Node.js, TypeScript)

  • Check this box to manually trigger a scan

Most Relevant Findings

The list below presents the 10 most relevant findings that need your attention. To view information on the remaining findings, navigate to the Mend Application.

SeverityVulnerability TypeCWEFileData FlowsDate
HighSession Fixation

CWE-384

with_cookie_and_session.php:8

12024-07-22 06:43pm
Vulnerable Code

require __DIR__.'/common.inc';
setcookie('abc', 'def');
session_set_save_handler(new TestSessionHandler('abc|i:123;'), false);
session_start();

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Session Fixation Training

● Videos

   ▪ Secure Code Warrior Session Fixation Video

● Further Reading

   ▪ OWASP Session Hijacking Attack

   ▪ OWASP Session Management Cheat Sheet

 
HighFile Manipulation

CWE-73

DotenvDumpCommand.php:85

32024-07-22 06:43pm
Vulnerable Code

// This file was generated by running "php bin/console dotenv:dump $env"
return $vars;
EOF;
file_put_contents($dotenvPath.'.local.php', $vars, \LOCK_EX);

3 Data Flow/s detected
View Data Flow 1

$config += (is_file($composerFile) ? json_decode(file_get_contents($composerFile), true) : [])['extra']['runtime'] ?? [];

$dotenvPath = $projectDir.'/'.($config['dotenv_path'] ?? '.env');

file_put_contents($dotenvPath.'.local.php', $vars, \LOCK_EX);

View Data Flow 2

$config += (is_file($composerFile) ? json_decode(file_get_contents($composerFile), true) : [])['extra']['runtime'] ?? [];

$envKey = $config['env_var_name'] ?? 'APP_ENV';

file_put_contents($dotenvPath.'.local.php', $vars, \LOCK_EX);

View Data Flow 3

$config += (is_file($composerFile) ? json_decode(file_get_contents($composerFile), true) : [])['extra']['runtime'] ?? [];

$envKey = $config['env_var_name'] ?? 'APP_ENV';

file_put_contents($dotenvPath.'.local.php', $vars, \LOCK_EX);

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior File Manipulation Training

● Videos

   ▪ Secure Code Warrior File Manipulation Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighSession Fixation

CWE-384

with_cookie_and_session.php:10

12024-07-22 06:43pm
Vulnerable Code

setcookie('abc', 'def');
session_set_save_handler(new TestSessionHandler('abc|i:123;'), false);
session_start();
session_write_close();
session_start();

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Session Fixation Training

● Videos

   ▪ Secure Code Warrior Session Fixation Video

● Further Reading

   ▪ OWASP Session Hijacking Attack

   ▪ OWASP Session Management Cheat Sheet

 
HighSession Fixation

CWE-384

AbstractProxyTest.php:108

12024-07-22 06:43pm
Vulnerable Code

* @preserveGlobalState disabled
*/
public function testIdException()
{
$this->expectException(\LogicException::class);
session_start();

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Session Fixation Training

● Videos

   ▪ Secure Code Warrior Session Fixation Video

● Further Reading

   ▪ OWASP Session Hijacking Attack

   ▪ OWASP Session Management Cheat Sheet

 
HighSession Fixation

CWE-384

AbstractProxyTest.php:83

12024-07-22 06:43pm
Vulnerable Code

* @preserveGlobalState disabled
*/
public function testNameException()
{
$this->expectException(\LogicException::class);
session_start();

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Session Fixation Training

● Videos

   ▪ Secure Code Warrior Session Fixation Video

● Further Reading

   ▪ OWASP Session Hijacking Attack

   ▪ OWASP Session Management Cheat Sheet

 
HighPath/Directory Traversal

CWE-22

SymfonyTestsListenerTrait.php:251

12024-07-22 06:43pm
Vulnerable Code

public function endTest($test, $time): void
{
if ($file = getenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE')) {
putenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE');
$expectedDeprecations = file_get_contents($file);

1 Data Flow/s detected

if ($file = getenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE')) {

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Path/Directory Traversal Training

● Videos

   ▪ Secure Code Warrior Path/Directory Traversal Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighSession Fixation

CWE-384

NativeSessionStorageTest.php:274

12024-07-22 06:43pm
Vulnerable Code

$this->assertSame(7, $storage->getBag('attributes')->get('lucky'), 'Data still available');
}
public function testCanCreateNativeSessionStorageWhenSessionAlreadyStarted()
{
session_start();

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Session Fixation Training

● Videos

   ▪ Secure Code Warrior Session Fixation Video

● Further Reading

   ▪ OWASP Session Hijacking Attack

   ▪ OWASP Session Management Cheat Sheet

 
HighSession Fixation

CWE-384

NativeSessionStorageTest.php:283

12024-07-22 06:43pm
Vulnerable Code

$this->addToAssertionCount(1);
}
public function testSetSessionOptionsOnceSessionStartedIsIgnored()
{
session_start();

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Session Fixation Training

● Videos

   ▪ Secure Code Warrior Session Fixation Video

● Further Reading

   ▪ OWASP Session Hijacking Attack

   ▪ OWASP Session Management Cheat Sheet

 
HighPath/Directory Traversal

CWE-22

ExpectDeprecationTraitForV8_4.php:32

12024-07-22 06:43pm
Vulnerable Code

// Expected deprecations set by isolated tests need to be written to a file
// so that the test running process can take account of them.
if ($file = getenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE')) {
$this->getTestResultObject()->beStrictAboutTestsThatDoNotTestAnything(false);
$expectedDeprecations = file_get_contents($file);

1 Data Flow/s detected

if ($file = getenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE')) {

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Path/Directory Traversal Training

● Videos

   ▪ Secure Code Warrior Path/Directory Traversal Video

● Further Reading

   ▪ OWASP Path Traversal

   ▪ OWASP Input Validation Cheat Sheet

 
HighDeserialization of Untrusted Data

CWE-502

LoggerDataCollector.php:186

12024-07-22 06:43pm
Vulnerable Code

return [];
}
$bootTime = filemtime($file);
$logs = [];
foreach (unserialize($logContent) as $log) {

1 Data Flow/s detected

if ('' === $logContent = trim(file_get_contents($file))) {

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Deserialization of Untrusted Data Training

● Videos

   ▪ Secure Code Warrior Deserialization of Untrusted Data Video

● Further Reading

   ▪ OWASP Deserialization Cheat Sheet

   ▪ OWASP Top Ten 2017 A8: Insecure Deserialization

   ▪ OWASP Deserialization of untrusted data

Findings Overview

Severity Vulnerability Type CWE Language Count
High Command Injection CWE-78 PHP 3
High Cross-Site Scripting CWE-79 PHP 4
High Deserialization of Untrusted Data CWE-502 PHP 12
High Session Fixation CWE-384 PHP 22
High Code Injection CWE-94 PHP 4
High File Manipulation CWE-73 PHP 12
High Path/Directory Traversal CWE-22 PHP 5
High SQL Injection CWE-89 PHP 1
Medium XML External Entity (XXE) Injection CWE-611 PHP 1
Medium Hidden HTML Input CWE-472 PHP 9
Medium LDAP Injection CWE-90 PHP 1
Medium Regex Denial of Service (ReDoS) CWE-400 PHP 2
Medium Hardcoded Password/Credentials CWE-798 PHP 28
Medium Log Messages Information Leak CWE-209 PHP 2
Low File Upload CWE-434 PHP 15
Low Cookie Without 'HttpOnly' Flag CWE-1004 PHP 22
Low Dangerous File Extensions CWE-530 PHP 2
Low Weak Encryption Strength CWE-326 PHP 33
Low HTTP Response Splitting CWE-113 PHP 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions