Security hardening, PHP 8.1+ compatibility, and dependency modernization#14
Draft
Security hardening, PHP 8.1+ compatibility, and dependency modernization#14
Conversation
- Replace deprecated mime_content_type() with finfo_file() for PHP 8.1+ compatibility - Fix path traversal vulnerability in Template.php getInlineJs() with whitelist validation - Replace direct $_GET/$_COOKIE access with Magento RequestInterface in all files - Fix XSS vulnerability in react-header.phtml by using json_encode() for JS output - Update npm dependencies: React 16→18, Webpack 4→5, Babel 7.4→7.23 - Update webpack.config.js for Webpack 5 compatibility - Add PHPDoc type hints to security-critical methods Co-authored-by: Genaker <9213670+Genaker@users.noreply.github.com>
- Fix directory traversal in PostDeployCopy.php using RecursiveDirectoryIterator - Add symlink protection to prevent traversal attacks - Remove error suppression operator from react-header.phtml template - Fix $_GET access in RemoveMagentoInitScripts.php - Add comprehensive SECURITY.md with security guidelines and best practices - Document vulnerability reporting process Co-authored-by: Genaker <9213670+Genaker@users.noreply.github.com>
- Add MockRequest class to Mocks.php implementing RequestInterface - Update DeferJS.test.php to use MockRequest for testing request parameters - Update DeferCSS.test.php to use MockRequest for testing request parameters - Tests now align with security improvements made to production code Co-authored-by: Genaker <9213670+Genaker@users.noreply.github.com>
- Fixed typo in react-header.phtml template - Fixed typo in react-core.js - Fixed typo in react-core.min.js - Consistent naming across all files Co-authored-by: Genaker <9213670+Genaker@users.noreply.github.com>
- Document all security fixes and their severity levels - List all dependency updates with version numbers - Include breaking changes and migration guide - Add verification status (code review, CodeQL passed) - Provide upgrade instructions for users Co-authored-by: Genaker <9213670+Genaker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve code quality and maintainability
Security hardening, PHP 8.1+ compatibility, and dependency modernization
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses critical security vulnerabilities, updates dependencies to current stable versions, and removes deprecated PHP functions.
Security Fixes
Path traversal in
Template.phpXSS in templates
Superglobal access replaced with RequestInterface
$_GET,$_COOKIE,$_POSTreplaced with$this->request->getParam()Template.php,DeferJS.php,DeferCSS.php,RemoveMagentoInitScripts.phpDirectory traversal in
PostDeployCopy.phpopendir()/readdir()withRecursiveDirectoryIteratorPHP 8.1+ Compatibility
Dependency Updates
Webpack 5 migration
Code Quality
@) operators with proper error handlingcurentUenc→currentUencacross codebaseMockRequestclass (replaces direct$_GETmanipulation)Documentation
SECURITY.md: Security guidelines, best practices, vulnerability reportingCHANGELOG.md: Migration guide for breaking changes (React 18, Webpack 5)Verification
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.