Skip to content

Commit 738a697

Browse files
committed
added query, qhelp
1 parent b0d9776 commit 738a697

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE qhelp PUBLIC
2+
"-//Semmle//qhelp//EN"
3+
"qhelp.dtd">
4+
5+
<qhelp>
6+
7+
<overview>
8+
<p> Do not use domains like <code>*.outlook.us</code> and <code>*.office.us</code> are domains that are not owned by Microsoft, or deprecated domains such as <code>goo.gl</code>.
9+
These domains are subject to domain squatting, which can introduce a security risk to services that trust them. </p>
10+
11+
<p>In addition to the above, <code>ajax.microsoft.com</code> and <code>ajax.aspnetcdn.com</code> host old JavaScript or old CSS in a non-production CDN. This CDN has no SLA, and could disappear at any time. We recommend that you move your assets local or serve them from a fully supported production CDN, such as the <a href="https://eng.ms/docs/experiences-devices/global-experiences-platform/es365/idc-fundamentals-1js/1js-monorepo/1js-repo-docs/team-documentation/midgard/engineering-system/cdn">M365 Shared CDN (1CDN)</a>.</p>
12+
</overview>
13+
14+
<recommendation>
15+
<p>Please remove any references to any obsolete domains</p>
16+
</recommendation>
17+
18+
<references>
19+
<li>Google: <a href="https://developers.googleblog.com/en/google-url-shortener-links-will-no-longer-be-available/">Google URL Shortener links will no longer be available</a>.</li>
20+
<li>AJAX CDN: <a href="https://learn.microsoft.com/en-us/aspnet/ajax/cdn/overview">AJAX CDN Overview</a></li>
21+
</references>
22+
</qhelp>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @name Use of deprecated domain
3+
* @description Referencing deprecated domains that are not owned by Microsoft can lead to security risks
4+
* @kind problem
5+
* @id powershell/domain-squatting-static
6+
* @problem.severity error
7+
* @precision high
8+
* @tags security
9+
*/
10+
11+
import powershell
12+
13+
string obsoleteDomain(){
14+
result = [
15+
"%.outlook.us%",
16+
"%.office.us%",
17+
"%goo.gl%",
18+
"%ajax.aspnetcdn.com%",
19+
"%ajax.microsoft.com%"
20+
]
21+
}
22+
23+
from StringLiteral s, string domain
24+
where
25+
domain = obsoleteDomain() and
26+
s.getValue().matches(domain)
27+
select s, "use of obsolete domain " + domain

0 commit comments

Comments
 (0)