fix(security): replace innerHTML with textContent in close.js#16939
Merged
saghul merged 2 commits intojitsi:masterfrom Feb 13, 2026
Merged
fix(security): replace innerHTML with textContent in close.js#16939saghul merged 2 commits intojitsi:masterfrom
saghul merged 2 commits intojitsi:masterfrom
Conversation
…ment-method-36-UkhxW04lYL fix: semgrep-insecure-document-method
|
Hi, thanks for your contribution! |
saghul
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the use of .innerHTML with .textContent in the insertTextMsg function within static/close.js. This change mitigates a potential DOM-based Cross-Site Scripting (XSS) vulnerability.
Rationale
During a security review of the static assets, innerHTML was identified as a dangerous sink in insertTextMsg.
Current state: The function takes a message string and injects it directly into the DOM. While current usage (e.g., APP_NAME) involves trusted strings, this pattern is inherently insecure.
The Improvement: Switching to .textContent ensures that any string passed is treated as literal text. This follows defense-in-depth principles by ensuring that even if configuration values were compromised or modified via external parameters, no script execution could occur.
Impact
Functionality: No impact on existing UI. Current messages are plain text and render identically with textContent.
Security: Eliminates the XSS risk associated with this function.
Testing Administered
Manual Verification: Verified the call-termination screen. "Thank You" and "Hint" messages render correctly.
Security Test: Confirmed that passing a string with HTML tags results in the tags being escaped/rendered as text rather than being executed by the browser.