Skip to content

Potential fix for code scanning alert no. 4: DOM text reinterpreted as HTML - #16

Merged
codinglombok merged 1 commit into
mainfrom
alert-autofix-4
Jul 21, 2026
Merged

Potential fix for code scanning alert no. 4: DOM text reinterpreted as HTML#16
codinglombok merged 1 commit into
mainfrom
alert-autofix-4

Conversation

@codinglombok

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/codinglombok/LombokCSS/security/code-scanning/4

Best-practice fix: validate and constrain DOM-derived values before using them to build URLs/attributes, and build query strings with URLSearchParams so values are encoded safely.

For this file, the strongest minimal fix is:

  1. Add small allowlist sanitizers for style, theme, dir, and data-page.
  2. Use those sanitizers when initializing from query params and when reading data-style-set.
  3. Replace manual query-string concatenation with new URLSearchParams(...).toString().
  4. Only rewrite href when data-page is a safe relative page token (no javascript:, no absolute URL, no dangerous chars).

This addresses both variants by ensuring DOM text is normalized before any downstream use.

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

…s HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codinglombok
codinglombok marked this pull request as ready for review July 21, 2026 04:45
@codinglombok
codinglombok merged commit ef3f47f into main Jul 21, 2026
15 of 19 checks passed
@codinglombok
codinglombok deleted the alert-autofix-4 branch July 21, 2026 04:46
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