Skip to content

Fix multiple security vulnerabilities across Gyro PHP#50

Open
onetechgroupll wants to merge 4 commits intogerdriesselmann:masterfrom
onetechgroupll:claude/fix-gyro-security-oIKZ8
Open

Fix multiple security vulnerabilities across Gyro PHP#50
onetechgroupll wants to merge 4 commits intogerdriesselmann:masterfrom
onetechgroupll:claude/fix-gyro-security-oIKZ8

Conversation

@onetechgroupll
Copy link
Copy Markdown

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

claude added 4 commits March 5, 2026 14:40
- 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
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