Skip to content

Potential fix for code scanning alert no. 8: Incomplete multi-character sanitization - #46

Merged
JordanNewell merged 1 commit into
mainfrom
alert-autofix-8
Nov 23, 2026
Merged

JordanNewell merged 1 commit into
mainfrom
alert-autofix-8

Conversation

@JordanNewell

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/dotcurt/dot_curt/security/code-scanning/8

Use a robust HTML-to-text conversion approach instead of regex-based partial sanitization. The best minimal fix here (without changing intended functionality) is to avoid decoding < and > back into angle brackets, since that is what can reintroduce tag syntax after tag-removal passes.

Concretely in scripts/gen-llms-txt.mjs, inside htmlToText:

  • Keep existing tag-removal pipeline.
  • In the entity-decoding block (lines 40–45), remove the replacements for < and >.
  • Keep decoding of &, ", ', and  .

This preserves readable text output while preventing reconstructed <script>/HTML tags from appearing after sanitization.

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

…er sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@JordanNewell
JordanNewell marked this pull request as ready for review November 23, 2026 11:24
@JordanNewell
JordanNewell merged commit c2f8aee into main Nov 23, 2026
13 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