Repository navigation
fix(frontend-ng): harden URL bindings in SigmaRule and LinkRedirectWarning - #3982
Merged
Merged
Conversation
…rning - Render SigmaRule references as plain text items rather than unvalidated :href links (matching falsepositives). - Validate LinkRedirectWarning contextUrl for http/https protocols before binding to :href, and remove redundant DOMPurify.sanitize calls inside text interpolations that double-escaped ampersands. - Add Vitest unit tests for SigmaRule and LinkRedirectWarning.
jaegeral
force-pushed
the
2026-11-11_eliminate-xss
branch
from
November 12, 2026 15:30
b873ade to
df28984
Compare
Collaborator
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the LinkRedirectWarning component to safely validate external redirect URLs using the URL API, disabling the continue button for unsafe schemes and adding corresponding unit tests. It also removes clickable links from the references list in SigmaRule.vue to prevent potential security issues. The review feedback points out that completely removing clickable links in SigmaRule.vue is a usability regression, and recommends conditionally rendering only safe http and https links while keeping unsafe schemes as plain text, along with updating the unit tests to verify this behavior.
Collaborator
Author
|
I did github review and a different code review. This will hopefully clean xss. |
jaegeral
added a commit
to jaegeral/timesketch
that referenced
this pull request
Nov 24, 2026
…rning (google#3982) - Render SigmaRule references as plain text items rather than unvalidated :href links (matching falsepositives). - Validate LinkRedirectWarning contextUrl for http/https protocols before binding to :href, and remove redundant DOMPurify.sanitize calls inside text interpolations that double-escaped ampersands. - Add Vitest unit tests for SigmaRule and LinkRedirectWarning.
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.
Description
Hardens remaining URL bindings across
timesketch/frontend-ngcomponents:SigmaRule.vue(references): Render Sigma rulereferencesas plain text items (<li>{{ ref }}</li>, matchingfalsepositivesdirectly below) instead of unvalidated<a :href="ref">links that could executejavascript:URIs when clicked.LinkRedirectWarning.vue(contextUrl/contextValue):contextUrlvianew URL()so onlyhttp:andhttps:URLs are bound to:hrefon thecontinuebutton (safeContextUrl), disabling the button otherwise and addingrel="noopener noreferrer".{{ getContextValue }}and{{ getContextUrl }}(DOMPurify.sanitize()inside{{ }}text interpolations, which double-escaped&as&) with direct{{ contextValue }}and{{ contextUrl }}text interpolations.Tests
SigmaRule.test.jsandLinkRedirectWarning.test.js.