Skip to content

Conversation

@andrasbacsai
Copy link
Member

Summary

This PR enhances security across database backup operations, file storage management, PostgreSQL init scripts, and proxy configuration handling by implementing comprehensive input validation and shell argument escaping to prevent command injection attacks.

Changes

  • Added validateShellSafePath() validation calls for database names in backup operations (MongoDB, PostgreSQL, MySQL, MariaDB)
  • Implemented escapeshellarg() escaping for all shell commands involving user-provided paths and filenames
  • Updated PostgreSQL init script management with validation and escaping
  • Added path validation for file storage operations
  • Secured proxy configuration filename handling in dynamic configuration management

Testing

Added comprehensive security test suites:

  • DatabaseBackupSecurityTest.php - Tests command injection prevention in database backup operations
  • FileStorageSecurityTest.php - Tests path validation and escaping for file storage
  • PostgresqlInitScriptSecurityTest.php - Tests filename validation for PostgreSQL init scripts
  • ProxyConfigurationSecurityTest.php - Tests filename validation for proxy configurations

All tests verify that malicious inputs are rejected and legitimate inputs are properly escaped.

… paths, and proxy configuration filenames to prevent command injection
@andrasbacsai andrasbacsai changed the base branch from v4.x to next November 27, 2025 13:38
@andrasbacsai andrasbacsai merged commit 31e2ac4 into next Nov 27, 2025
4 checks passed
@andrasbacsai andrasbacsai deleted the security-validation-escaping branch November 27, 2025 13:54
@andrasbacsai andrasbacsai mentioned this pull request Nov 27, 2025
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.

1 participant