Fix multiple security vulnerabilities across Gyro PHP#50
Open
onetechgroupll wants to merge 4 commits intogerdriesselmann:masterfrom
Open
Fix multiple security vulnerabilities across Gyro PHP#50onetechgroupll wants to merge 4 commits intogerdriesselmann:masterfrom
onetechgroupll wants to merge 4 commits intogerdriesselmann:masterfrom
Conversation
- Use CSPRNG (random_bytes) for token generation instead of mt_rand/uniqid - Add allowed_classes restriction to all unserialize() calls to prevent object injection (core serialized fields, APCu/file/XCache/Sphinx caches) - Escape backticks in MySQL escape_database_entity() to prevent SQL injection - Fix host header injection by validating against configured domain - Harden session security: add SameSite=Lax, strict mode, httponly defaults, remove deprecated session.bug_compat_42 setting - Fix XSS in ConverterHtmlEx heading output (missing escape) - Use timing-safe hash_equals() in MD5/SHA1 password hash checks - Add bcrypt password hash implementation using password_hash/password_verify - Restrict phpinfo() endpoint to test mode only - Add security response headers: X-Content-Type-Options, X-Frame-Options, Referrer-Policy https://claude.ai/code/session_01CgKaiM8rgChKCVabFePNu5
- Add escapeshellarg() to all jcssmanager exec() calls (webpack, uglifyjs,
postcss, csso, yui compressors) to prevent shell injection via file paths
- Remove debug echo of shell command in uglifyjs compressor
- Sanitize table names in deletedialog templates to prevent path traversal
via get_table_name() in include paths
- Replace eval() with call_user_func() in punycode uctc.php converter
- Replace shell_exec('mkdir') with PHP native mkdir() in install script
- Replace md5(uniqid()) with random_bytes() in install precondition check
https://claude.ai/code/session_01CgKaiM8rgChKCVabFePNu5
- Fix reflected XSS in punycode example.php: escape $_SERVER['PHP_SELF'] and $_REQUEST['lang'] with htmlspecialchars() - Fix wymeditor tidy plugin: add Content-Type header, fix deprecated get_magic_quotes_gpc() check, handle missing input - Replace insecure rand() with random_int() for feed token generation in notifications settings - Change directory creation permissions from 0777 to 0755 in install https://claude.ai/code/session_01CgKaiM8rgChKCVabFePNu5
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.
Summary
CRITICAL: Replace insecure token generation (mt_rand/uniqid) with random_bytes(), fix insecure unserialize() in 6 files, fix command injection in 5 jcssmanager compressors via escapeshellarg()
HIGH: Fix SQL injection via backtick escaping in MySQL driver, host header injection validation, path traversal in deletedialog templates, replace eval() with call_user_func(), fix XSS in punycode example, add phpinfo access control
MEDIUM/LOW: Harden session security (SameSite, strict mode, httponly), add security response headers, fix timing attacks in hash comparison with hash_equals(), add bcrypt password hashing, replace rand() with random_int(), fix chmod 0777 to 0755
29 files changed across 17 vulnerability categories.
Test plan
Verify token generation still produces valid tokens
Test login/authentication flow with hash_equals changes
Test session handling across browsers (SameSite cookie support)
Verify jcssmanager asset compilation still works with escapeshellarg
Test deletedialog templates render correctly
Confirm security headers present in HTTP responses
Verify phpinfo route returns 404 when not in TESTMODE