@@ -31,22 +31,34 @@ advisory:
31
31
JavaScript payloads through carefully crafted URLs.
32
32
33
33
Snippet from "frames.erb":
34
+ (v0.9.34)
34
35
```erb
35
36
<script type="text/javascript">
36
37
var match = unescape(window.location.hash).match(/^#!(.+)/);
37
- var name = match ? match[1] : '<= url_for_main >';
38
+ var name = match ? match[1] : '<% = url_for_main % >';
38
39
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
39
40
window.top.location = name;
40
41
</script>
41
42
```
42
43
44
+ (v0.9.35)
45
+ ```erb
46
+ <script type="text/javascript">
47
+ var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
48
+ var name = match ? match[1] : '<%= url_for_main % >';
49
+ name = name.replace(/^((\w*):)?[\/\\]*/gm, '').trim();
50
+ window.top.location.replace(name)
51
+ </script>
52
+ ```
53
+
43
54
### PoC (Proof of Concept)
44
55
45
56
To exploit this vulnerability:
46
57
1. Gain access to the generated Yard Doc.
47
58
2. Locate and access the "frames.html" file.
48
59
3. Construct a URL containing the malicious payload in the hash
49
- segment, for instance: `#!javascript:xss`
60
+ segment, for instance: `#!javascript:xss` for v0.9.34, and
61
+ `#:javascript:xss` for v0.9.35
50
62
51
63
### Impact
52
64
@@ -60,12 +72,14 @@ advisory:
60
72
the application's integrity.
61
73
cvss_v3 : 5.4
62
74
patched_versions :
63
- - " >= 0.9.35 "
75
+ - " >= 0.9.36 "
64
76
related :
65
77
url :
66
- - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-27285
67
- - https://github.com/lsegal/yard/releases/tag/v0.9.35
68
78
- https://github.com/lsegal/yard/security/advisories/GHSA-8mq4-9jjh-9xrc
69
79
- https://github.com/lsegal/yard/commit/2069e2bf08293bda2fcc78f7d0698af6354054be
80
+ - https://nvd.nist.gov/vuln/detail/CVE-2024-27285
70
81
- https://github.com/advisories/GHSA-8mq4-9jjh-9xrc
82
+ - https://github.com/rubysec/ruby-advisory-db/blob/master/gems/yard/CVE-2024-27285.yml
83
+ - https://github.com/lsegal/yard/pull/1538
84
+ - https://github.com/lsegal/yard/commit/1fcb2d8b316caf8779cfdcf910715e9ab583f0aa
71
85
---
0 commit comments