You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing validation of the MessageEvent.origin allows any window to send arbitrary messages to the postMessage handler from any origin.
If the MessageEvent.data is used in some DOM sink and is used in an unsafe way, the missing check of the origin could lead to a DOM-based XSS or other unexpected behaviors.
This query detects if the MessageEvent.origin is checked or if methods like indexOf, startsWith are used to validate the origin.
Created Hackerone report 920285 for bounty 228297 : [118] [javascript] CWE-020: CodeQL query to detect missing origin validation in cross-origin communication via postMessage 🎉
CVE ID(s)
Report
Missing validation of the
MessageEvent.origin
allows any window to send arbitrary messages to thepostMessage
handler from any origin.If the
MessageEvent.data
is used in some DOM sink and is used in an unsafe way, the missing check of the origin could lead to aDOM-based XSS
or other unexpected behaviors.This query detects if the
MessageEvent.origin
is checked or if methods likeindexOf
,startsWith
are used to validate the origin.Link to the now merged PR: PR github/codeql#3646
The text was updated successfully, but these errors were encountered: