Skip to content

fix: validate URL query params and harden JSON-LD against reflected XSS - #818

Merged
nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
DooseWayo:fix/sanitize-query-params-xss
Oct 17, 2026
Merged

nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
DooseWayo:fix/sanitize-query-params-xss

Conversation

@DooseWayo

Copy link
Copy Markdown
  • Add src/lib/queryParams.ts with parseEnumParam, parsePageParam, sanitizeSearchParam and serializeJsonLd helpers
  • Policies page: whitelist status/sort/view params, strictly parse page, strip control/bidi chars from q and cap it at 100 chars; values are rendered only through React's text escaping
  • Home page: escape <, >, & and U+2028/2029 in the inline JSON-LD script so product data cannot break out of the <script> tag
  • Add XSS test cases covering crafted ?q payloads and invalid params

Closes #802
Closes #799
Closes #800
Closes #801

- Add src/lib/queryParams.ts with parseEnumParam, parsePageParam,
  sanitizeSearchParam and serializeJsonLd helpers
- Policies page: whitelist status/sort/view params, strictly parse page,
  strip control/bidi chars from q and cap it at 100 chars; values are
  rendered only through React's text escaping
- Home page: escape <, >, & and U+2028/2029 in the inline JSON-LD script
  so product data cannot break out of the <script> tag
- Add XSS test cases covering crafted ?q payloads and invalid params

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for boisterous-sunshine-dd4c4c failed.

Name Link
🔨 Latest commit 7f429fd
🔍 Latest deploy log https://app.netlify.com/projects/boisterous-sunshine-dd4c4c/deploys/6ad32abdf784be315a674c9c

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@DooseWayo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nonsobethel0-dev
nonsobethel0-dev merged commit 78e1361 into Parashield-Protocol:main Oct 17, 2026
0 of 4 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

2 participants