Skip to content

Commit e84339d

Browse files
dellaliberaesbena
andauthored
Update javascript/ql/src/experimental/Security/CWE-020/PostMessageNoOriginCheck.qhelp
Co-authored-by: Esben Sparre Andreasen <[email protected]>
1 parent 71a7ec5 commit e84339d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/experimental/Security/CWE-020/PostMessageNoOriginCheck.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Always verify the sender's identity of incoming messages.
2121
<p>In the first example, the `MessageEvent.data` is passed to the `eval` function withouth checking the origin. This means that any window can send arbitrary messages that will be executed in the window receiving the message</p>
2222
<sample src="examples/postMessageNoOriginCheck.js" />
2323

24-
<p> In the second example, the `MessageEvent.origin` is verified with an unsecure check. For example, using `event.origin.indexOf('www.example.com') > -1` can be baypassed because the string `www.example.com` could appear anywhere in `event.origin` (i.e. `www.example.com.mydomain.com`)
24+
<p> In the second example, the `MessageEvent.origin` is verified with an unsecure check. For example, using `event.origin.indexOf('www.example.com') > -1` can be bypassed because the string `www.example.com` could appear anywhere in `event.origin` (i.e. `www.example.com.mydomain.com`)</p>
2525
<sample src="examples/postMessageWithInsufficientCheck.js" />
2626

2727
<p> In the third example, the `MessageEvent.origin` is properly checked against a trusted origin.
@@ -37,4 +37,4 @@ Always verify the sender's identity of incoming messages.
3737
<li><a href="https://labs.detectify.com/2016/12/08/the-pitfalls-of-postmessage/">The pitfalls of postMessage</a></li>
3838

3939
</references>
40-
</qhelp>
40+
</qhelp>

0 commit comments

Comments
 (0)