Skip to content

fix(pydesk): resolve CodeQL XSS alert #15 in WebSocket handler#8128

Merged
h0lybyte merged 1 commit intodevfrom
trunk/fix-codeql-15-1773702839
Mar 16, 2026
Merged

fix(pydesk): resolve CodeQL XSS alert #15 in WebSocket handler#8128
h0lybyte merged 1 commit intodevfrom
trunk/fix-codeql-15-1773702839

Conversation

@h0lybyte
Copy link
Member

Summary

  • Fixes CodeQL code-scanning alert Pulling refs/heads/patch-atomic-10-14-2023-1697302089 into Dev #15 (js/xss, CWE-79)
  • Added escapeHtml() helper that uses DOM createTextNode for safe HTML entity encoding
  • Sanitized formatJsonDisplay() to escape both keys and values from WebSocket data
  • Applied escapeHtml() to JSON.stringify(data) and command before innerHTML insertion
  • All user-controlled WebSocket data is now escaped before DOM injection

Test plan

Add escapeHtml() helper and apply it to all WebSocket message data
and user input before innerHTML insertion. Resolves CodeQL alert #15
(js/xss, CWE-79).
@github-actions
Copy link
Contributor

Dependency Review

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

Scanned Files

None

@h0lybyte h0lybyte merged commit 247c4ca into dev Mar 16, 2026
5 checks passed
@h0lybyte h0lybyte deleted the trunk/fix-codeql-15-1773702839 branch March 16, 2026 23:36
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