Skip to content

Commit b4fbe1b

Browse files
committed
Adding an test file
1 parent f7b73be commit b4fbe1b

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

cypress/platform/xss15.html

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<html>
2+
<head>
3+
<link
4+
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
5+
rel="stylesheet"
6+
/>
7+
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
9+
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
10+
<style>
11+
body {
12+
/* background: rgb(221, 208, 208); */
13+
/* background:#333; */
14+
font-family: 'Arial';
15+
/* font-size: 18px !important; */
16+
}
17+
h1 { color: grey;}
18+
.mermaid2 {
19+
display: none;
20+
}
21+
.mermaid svg {
22+
/* font-size: 18px !important; */
23+
}
24+
.malware {
25+
position: fixed;
26+
bottom:0;
27+
left:0;
28+
right:0;
29+
height: 150px;
30+
background: red;
31+
color: black;
32+
display: flex;
33+
display: flex;
34+
justify-content: center;
35+
align-items: center;
36+
font-family: monospace;
37+
font-size: 72px;
38+
}
39+
</style>
40+
</head>
41+
<body>
42+
<div>Security check</div>
43+
<div class="flex">
44+
<div id="diagram" class="mermaid"></div>
45+
<div id="res" class=""></div>
46+
<script src="./mermaid.js"></script>
47+
<script>
48+
mermaid.parseError = function (err, hash) {
49+
// console.error('Mermaid error: ', err);
50+
};
51+
mermaid.initialize({
52+
theme: 'forest',
53+
arrowMarkerAbsolute: true,
54+
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
55+
logLevel: 0,
56+
state: {
57+
defaultRenderer: 'dagre-d3',
58+
},
59+
flowchart: {
60+
// defaultRenderer: 'dagre-wrapper',
61+
nodeSpacing: 10,
62+
curve: 'cardinal',
63+
htmlLabels: true,
64+
},
65+
htmlLabels: true,
66+
// gantt: { axisFormat: '%m/%d/%Y' },
67+
sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
68+
// sequenceDiagram: { actorMargin: 300 } // deprecated
69+
// fontFamily: '"times", sans-serif',
70+
// fontFamily: 'courier',
71+
fontSize: 18,
72+
curve: 'basis',
73+
securityLevel: 'strict ',
74+
startOnLoad: false,
75+
secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
76+
// themeVariables: {relationLabelColor: 'red'}
77+
});
78+
function callback() {
79+
alert('It worked');
80+
}
81+
function xssAttack() {
82+
const div = document.createElement('div');
83+
div.id = 'the-malware';
84+
div.className = 'malware';
85+
div.innerHTML = 'XSS Succeeded';
86+
document.getElementsByTagName('body')[0].appendChild(div);
87+
throw new Error('XSS Succeded');
88+
}
89+
90+
var diagram = `sequenceDiagram
91+
participant John
92+
links John: {"XSS": "javas`;
93+
diagram += 'cript:alert(window.opener.document.domain)"}';
94+
95+
// var diagram = "stateDiagram-v2\n";
96+
// diagram += "<img/src='1'/onerror"
97+
// diagram += "=xssAttack()> --> B";
98+
console.log(diagram);
99+
// document.querySelector('#diagram').innerHTML = diagram;
100+
mermaid.render('diagram', diagram, (res) => {
101+
console.log(res);
102+
document.querySelector('#res').innerHTML = res;
103+
});
104+
</script>
105+
</body>
106+
</html>
107+

0 commit comments

Comments
 (0)