Fix #545: Add support for HTML5 pointer and transition event handlers#909
Open
jeffrey-theog06 wants to merge 1 commit into
Open
Fix #545: Add support for HTML5 pointer and transition event handlers#909jeffrey-theog06 wants to merge 1 commit into
jeffrey-theog06 wants to merge 1 commit into
Conversation
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
This PR fixes an issue where successful XSS attacks using modern HTML5 event handlers (such as
onpointerover,onpointerenter, etc.) were not recognized by the Security Shepherd backend, preventing players from being awarded challenge completion.Root Cause
In XSS challenges where standard event handlers (like
onclickoronerror) are filtered, players bypass these filters using alternative event handlers. However, the backend validation helperFindXSS.javavalidates if XSS was successful by searching the sanitized input for specific event handlers defined in a hardcoded listjavascriptTriggers. Because pointer, animation, and transition events were missing from this list, the server did not detect the successful exploitation.Changes
FindXSS.java: Added the following event handlers to thejavascriptTriggersarray:onpointerdown,onpointerup,onpointercancel,onpointermove,onpointerover,onpointerout,onpointerenter,onpointerleave,ongotpointercapture,onlostpointercapture,onpointerrawupdateonanimationcancel,onanimationend,onanimationiteration,onanimationstartontransitioncancel,ontransitionend,ontransitionrun,ontransitionstartonauxclickFindXSSTest.java: Added unit tests (search_detectsOnpointeroverAlert,search_detectsOnpointerenterAlert) to verify that the pointer events successfully trigger XSS detection.Closes #545