Skip to content

Potential fix for code scanning alert no. 3: Double escaping or unescaping#321

Merged
modelorona merged 1 commit into
masterfrom
alert-autofix-3
May 3, 2026
Merged

Potential fix for code scanning alert no. 3: Double escaping or unescaping#321
modelorona merged 1 commit into
masterfrom
alert-autofix-3

Conversation

@modelorona

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/modelorona/Scroll-It/security/code-scanning/3

Decode HTML entities in a safe order by decoding & last, not first.

Best fix (minimal behavior change): in app_vue3/src/stores/gallery.ts, reorder the replacement chain for data.title so named/numeric entities are decoded first, then decode ampersands at the end. This preserves existing manual decoding behavior while removing the double-unescape condition flagged by CodeQL.

Specifically, edit the block around lines 241–249:

  • Keep the same entity mappings.
  • Move .replace(/&/g, '&') to the last replacement in the chain.
  • No new imports or dependencies required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…aping

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@modelorona modelorona marked this pull request as ready for review May 3, 2026 16:26
@modelorona modelorona merged commit 3f42024 into master May 3, 2026
6 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

Development

Successfully merging this pull request may close these issues.

1 participant