Skip to content

Sanitized above-fold image IDs to prevent XSS - #1116

Merged
poonam279 merged 2 commits into
developmentfrom
bugfix/optimole-service/1776
Aug 25, 2026
Merged

Sanitized above-fold image IDs to prevent XSS#1116
poonam279 merged 2 commits into
developmentfrom
bugfix/optimole-service/1776

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

Handling the above-the-fold image data in profiler debug comments to prevent XSS (cross-site scripting) via malformed or malicious image IDs.

Closes https://github.com/Codeinwp/optimole-service/issues/1776

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@girishpanchal30
girishpanchal30 force-pushed the bugfix/optimole-service/1776 branch from d4b8c0c to 3cebc53 Compare August 24, 2026 12:24
@pirate-bot

pirate-bot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Plugin build for c45ad03 is ready 🛎️!

@girishpanchal30
girishpanchal30 requested a balanced review from Copilot and removed request for Copilot August 24, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents stored XSS through profiler debug comments by validating image IDs and safely encoding profile data.

Changes:

  • Sanitizes submitted above-fold image IDs.
  • Hex-encodes HTML-sensitive JSON characters.
  • Adds an XSS regression test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
inc/rest.php Sanitizes submitted image IDs.
inc/v2/PageProfiler/Profile.php Safely encodes profiler comments.
tests/test-lazyload-viewport.php Tests comment breakout prevention.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread inc/rest.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@poonam279
poonam279 merged commit e31387a into development Aug 25, 2026
18 of 19 checks passed
@poonam279
poonam279 deleted the bugfix/optimole-service/1776 branch August 25, 2026 17:25
@pirate-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.2.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants