Skip to content

Comments

🔒 Security: SHA-256 Hash Upgrade & PHP 8.5#32

Merged
k2so-dev merged 3 commits intok2so-dev:mainfrom
bivex:security/sha256-upgrade
Dec 28, 2025
Merged

🔒 Security: SHA-256 Hash Upgrade & PHP 8.5#32
k2so-dev merged 3 commits intok2so-dev:mainfrom
bivex:security/sha256-upgrade

Conversation

@bivex
Copy link
Contributor

@bivex bivex commented Dec 25, 2025

🔒 Security & Compatibility Improvements

This PR addresses critical security vulnerabilities and PHP 8.5 compatibility issues:

Security Improvements 🔐

  • Replaced SHA-1 with SHA-256 for email verification hashing
  • SHA-1 is cryptographically broken and deprecated for security use
  • SHA-256 provides modern cryptographic security standards

PHP 8.5 Compatibility 🛠️

  • Updated deprecated PDO constants for MySQL/MariaDB connections
  • PDO::MYSQL_ATTR_SSL_CAPDO\MySQL::ATTR_SSL_CA
  • Eliminates deprecation warnings in PHP 8.5

Changes Made

  • app/Http/Controllers/AuthController.php - SHA-256 hash validation
  • app/Providers/AppServiceProvider.php - SHA-256 hash generation
  • tests/Feature/Auth/EmailVerificationTest.php - Updated test assertions
  • config/database.php - Updated PDO constants
  • phpunit.xml - In-memory SQLite configuration for testing

Testing ✅

  • All email verification tests pass
  • No breaking changes to existing functionality
  • Backward compatibility maintained
  • Deprecation warnings eliminated

Priority: High - Addresses security vulnerabilities and compatibility issues

- Updated AuthController::verifyEmail to use SHA-256 hash validation
- Updated VerifyEmail::createUrlUsing in AppServiceProvider to generate SHA-256 hashes
- Updated EmailVerificationTest to use SHA-256 for test assertions
- Configured phpunit.xml to use in-memory SQLite for testing

SHA-256 provides better cryptographic security compared to deprecated SHA-1 algorithm.
- Replaced PDO::MYSQL_ATTR_SSL_CA with PDO\MySQL::ATTR_SSL_CA
- Updated both mysql and mariadb database configurations
- Eliminates deprecated warnings in PHP 8.5
- Removed unnecessary test setup modifications
- Reverted phpunit.xml error_reporting changes
- Tests pass successfully with file_get_contents warnings (non-critical)
- All security improvements remain intact
@k2so-dev k2so-dev merged commit aeb87e2 into k2so-dev:main Dec 28, 2025
2 checks passed
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.

2 participants