Skip to content

Security fixes / Preview fix#455

Merged
skerbis merged 5 commits intomainfrom
security_fixes
Jan 29, 2026
Merged

Security fixes / Preview fix#455
skerbis merged 5 commits intomainfrom
security_fixes

Conversation

@skerbis
Copy link
Member

@skerbis skerbis commented Jan 29, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 29, 2026 18:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses critical security vulnerabilities and fixes several bugs in the REDAXO Consent Manager addon. The changes focus on improving XSS protection through proper JSON encoding, fixing a method call error in fragment rendering, and sanitizing user inputs.

Changes:

  • Security improvements: Input sanitization for URL parameters and proper JSON encoding with security flags to prevent XSS attacks
  • Bug fix: Corrected fragment method call from subparse() to parse() to fix undefined method error
  • Cleanup: Removed obsolete Namespace-Guide.md documentation file

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.yml Version bump from 5.3.2 to 5.3.3
lib/Frontend.php Added input sanitization for cid and v parameters; replaced manual string escaping with json_encode using security flags (JSON_HEX_TAG, JSON_HEX_APOS, JSON_HEX_AMP, JSON_HEX_QUOT) in both outputJavascript() and getJS() methods
fragments/ConsentManager/box.php Fixed undefined method error by changing from subparse() to parse()
CHANGELOG.md Added version 5.3.3 changelog entry documenting security fixes and bug fixes
Namespace-Guide.md Removed obsolete migration guide for version 5.0 namespace changes

Comment on lines 262 to 263
$boxtemplate = str_replace("\r", '', $boxtemplate);
$boxtemplate = str_replace("\n", ' ', $boxtemplate);
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newline and carriage return replacements (lines 262-263) are now redundant since json_encode will properly handle these characters. The getJS() method correctly removed these lines, but outputJavascript() still includes them. While not harmful, these lines should be removed for consistency with the getJS() method and to avoid unnecessary processing since json_encode already handles newlines correctly.

Suggested change
$boxtemplate = str_replace("\r", '', $boxtemplate);
$boxtemplate = str_replace("\n", ' ', $boxtemplate);

Copilot uses AI. Check for mistakes.
@skerbis skerbis merged commit 3fa20d7 into main Jan 29, 2026
11 checks passed
@skerbis skerbis deleted the security_fixes branch January 29, 2026 18:37
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