Skip to content

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

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

Potential fix for code scanning alert no. 4: DOM text reinterpreted as HTML#14
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>
@codinglombok
codinglombok marked this pull request as ready for review July 18, 2026 07:50
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

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

Scanned Files

None

@codinglombok
codinglombok merged commit ba1b535 into main Jul 18, 2026
14 of 18 checks passed
@codinglombok
codinglombok deleted the alert-autofix-4 branch July 18, 2026 07:50
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