Skip to content

Commit b0d9776

Browse files
committed
added query tests
1 parent 657686b commit b0d9776

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| test.ps1:2:15:2:46 | https://mail.outlook.us/api/v1 | use of obsolete domain %.outlook.us% |
2+
| test.ps1:5:14:5:45 | https://portal.office.us/admin | use of obsolete domain %.office.us% |
3+
| test.ps1:8:13:8:35 | https://goo.gl/abc123 | use of obsolete domain %goo.gl% |
4+
| test.ps1:11:11:11:70 | https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js | use of obsolete domain %ajax.aspnetcdn.com% |
5+
| test.ps1:14:14:14:68 | http://ajax.microsoft.com/ajax/4.0/1/MicrosoftAjax.js | use of obsolete domain %ajax.microsoft.com% |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
queries/security/cwe-829/DomainSquattingStatic.ql
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BAD: Uses outlook.us domain
2+
$outlookUrl = "https://mail.outlook.us/api/v1"
3+
4+
# BAD: Uses office.us domain
5+
$officeUrl = "https://portal.office.us/admin"
6+
7+
# BAD: Uses deprecated goo.gl shortener
8+
$shortUrl = "https://goo.gl/abc123"
9+
10+
# BAD: Uses deprecated ajax.aspnetcdn.com
11+
$cdnUrl = "https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.min.js"
12+
13+
# BAD: Uses deprecated ajax.microsoft.com
14+
$msAjaxUrl = "http://ajax.microsoft.com/ajax/4.0/1/MicrosoftAjax.js"
15+
16+
# GOOD: Uses valid Microsoft domains
17+
$validUrl1 = "https://outlook.office365.com/api/v1"
18+
$validUrl2 = "https://portal.azure.com"

0 commit comments

Comments
 (0)