mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
JS: Functionality from untrusted sources query (CWE-830)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
| test.html:6:9:6:56 | <script>...</> | HTML-element imports untrusted content (script elements should use an https link and/or use the integrity attribute) |
|
||||
| test.html:9:9:9:58 | <iframe>...</> | HTML-element imports untrusted content (iframe elements should use an https link) |
|
||||
| test.html:11:9:11:53 | <iframe>...</> | HTML-element imports untrusted content (iframe elements should use an https link) |
|
||||
@@ -0,0 +1 @@
|
||||
Security/CWE-830/FunctionalityFromUntrustedSource.ql
|
||||
13
javascript/ql/test/query-tests/Security/CWE-830/test.html
Normal file
13
javascript/ql/test/query-tests/Security/CWE-830/test.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://test.local/foo.js"></script>> <!-- NOT OK -->
|
||||
<script src="http://test.local/foo.js" integrity="some-integrity-hash"></script>> <!-- OK (integrity digest present) -->
|
||||
<script src="https://test.local/bar.js"></script>> <!-- OK (https) -->
|
||||
<iframe src="http://test.local/foo.html"></iframe> <!-- NOT OK -->
|
||||
<iframe src="https://test.local/foo.html"></iframe> <!-- OK (https) -->
|
||||
<iframe src="//test.local/foo.html"></iframe> <!-- NOT OK (protocol-relative url) -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user