Skip to content

fix: escape item.id and item.category in showcase card HTML attributes#85

Merged
sauravbhattacharya001 merged 1 commit intomasterfrom
fix/xss-showcase-card-attributes
Mar 28, 2026
Merged

fix: escape item.id and item.category in showcase card HTML attributes#85
sauravbhattacharya001 merged 1 commit intomasterfrom
fix/xss-showcase-card-attributes

Conversation

@sauravbhattacharya001
Copy link
Copy Markdown
Owner

Summary

Apply _escapeHtml() to item.id, item.category, and the category CSS class name in _renderCard() to prevent attribute-context XSS injection.

While current usage generates these values client-side (safe), this hardens against future changes where showcase data might come from external sources (API, URL params).

Changes

  • Escape data-id attribute values (article + like button)
  • Escape data-category attribute value
  • Escape category in CSS class name construction

Fixes #84

Apply _escapeHtml() to item.id, item.category, and the category CSS
class name in _renderCard() to prevent attribute injection XSS.

While current usage generates these values client-side, this hardens
against future changes where data might come from external sources.

Fixes #84
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added app Core application changes frontend Frontend/UI changes labels Mar 21, 2026
@sauravbhattacharya001 sauravbhattacharya001 merged commit 47d877f into master Mar 28, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Core application changes frontend Frontend/UI changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XSS: unescaped item.id in showcase card HTML attributes

1 participant