Skip to content

Conversation

@remus-iesan-natterbox
Copy link

@remus-iesan-natterbox remus-iesan-natterbox commented Sep 17, 2025

This pull request addresses a security vulnerability in the SelfUpdate.php file related to path traversal. The vulnerability could have allowed an attacker to overwrite files outside the intended directory by manipulating the target filename during the self-update process.

Changes Made

  • Introduced validation using realpath($this->filename) to resolve the absolute path of the target file.
  • Ensured the resolved path is within the application's current working directory by checking it starts with getcwd().
  • If the target filename is invalid or points outside the allowed directory, an exception is thrown and the update does not proceed.
  • The PHAR file is only renamed and updated if all security checks pass.

Motivation

This change is necessary to prevent potential path traversal attacks during the self-update process, ensuring that updates cannot overwrite files outside the application directory.

@natterbox-integration
Copy link

natterbox-integration commented Sep 17, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants