Skip to content

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

index.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,62 @@
5959
<script src="js/webrtc.js"></script>
6060
<iframe src="./iframe-webrtc-test.html" sandbox="allow-scripts" width="100%" height="200"></iframe>
6161

62+
<!-- DNS prefetch check, originally developed by Cure53
63+
and distributed as "Cure53 Test App - DNS checker" app.
64+
See https://delta.chat/en/2023-05-22-webxdc-security#dns-prefetching-marks-another-exploit. -->
65+
<div class="dns-prefetch-output">
66+
<header class="container">
67+
<h2>DNS Prefetch</h2>
68+
</header>
69+
<div class="container">
70+
<section>
71+
<p>Usage instructions:</p>
72+
<ol>
73+
<li>
74+
Navigate to
75+
<a href="https://dig.pm/">https://dig.pm/</a>
76+
and click Get Sub Domain.
77+
</li>
78+
<li>Input the subdomain from Step 1.</li>
79+
<li>Click all 3 of the buttons.</li>
80+
<li>Click Get Results on https://dig.pm/.</li>
81+
<li>Observe the DNS lookup record.</li>
82+
</ol>
83+
<p>
84+
Also see
85+
<a href="https://public.opentech.fund/documents/XDC-01-report_2_1.pdf">the audit</a>
86+
and
87+
<a href="https://delta.chat/en/2023-05-22-webxdc-security">the blog post</a>.
88+
</p>
89+
</section>
90+
<p>You can also utilize Wireshark, then https://dig.pm/ is not needed.</p>
91+
<input
92+
id="dns-prefetch-domain-input"
93+
type="text"
94+
placeholder="abc.example.com"
95+
required
96+
/>
97+
<br>
98+
<button
99+
type="button"
100+
onclick="dnsPrefetchUpdateLocation()"
101+
>Update top.location</button>
102+
<br>
103+
<button
104+
type="button"
105+
onclick="dnsPrefetchAddIframe()"
106+
>Add iframe</button>
107+
<br>
108+
<button
109+
type="button"
110+
onclick="dnsPrefetchAddPrefetch()"
111+
>Add &lt;link dns-prefetch&gt;</button>
112+
<br>
113+
<iframe id="dns-prefetch-frame"></iframe>
114+
</div>
115+
</div>
116+
<script src="js/dns-prefetch.js"></script>
117+
62118
<div class="card">
63119
<header class="container"><h2>Webxdc Status Update Tests</h2></header>
64120
<div class="container">

js/dns-prefetch.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const getInput = () => document.getElementById("dns-prefetch-domain-input");
2+
3+
function dnsPrefetchUpdateLocation() {
4+
let domain = getInput().value;
5+
top.location = "https://" + domain
6+
alert('Please check DNS record')
7+
}
8+
9+
function dnsPrefetchAddIframe() {
10+
const domain = getInput().value;
11+
const iframe = document.createElement('iframe')
12+
iframe.src = "https://" + domain
13+
getInput().parentElement.appendChild(iframe)
14+
}
15+
16+
function dnsPrefetchAddPrefetch() {
17+
const domain = getInput().value;
18+
document.getElementById('dns-prefetch-frame').srcdoc =
19+
`<link rel="dns-prefetch" href="https://${domain}" /> dns prefetch: ${domain}`;
20+
}

0 commit comments

Comments
 (0)