|
| 1 | += RDoc 2.3.0 through 3.12 XSS Exploit |
| 2 | + |
| 3 | +RDoc documentation generated by rdoc 2.3.0 through rdoc 3.12 and prereleases up |
| 4 | +to rdoc 4.0.0.preview2.1 are vulnerable to an XSS exploit. This exploit may |
| 5 | +lead to cookie disclosure to third parties. |
| 6 | + |
| 7 | +The exploit exists in darkfish.js which is copied from the RDoc install |
| 8 | +location to the generated documentation. |
| 9 | + |
| 10 | +RDoc is a static documentation generation tool. Patching the library itself |
| 11 | +is insufficient to correct this exploit. Those hosting rdoc documentation will |
| 12 | +need to apply the following patch. If applied while ignoring whitespace, this |
| 13 | +patch will correct all affected versions: |
| 14 | + |
| 15 | + diff --git darkfish.js darkfish.js |
| 16 | + index 4be722f..f26fd45 100644 |
| 17 | + --- darkfish.js |
| 18 | + +++ darkfish.js |
| 19 | + @@ -109,13 +109,15 @@ function hookSearch() { |
| 20 | + function highlightTarget( anchor ) { |
| 21 | + console.debug( "Highlighting target '%s'.", anchor ); |
| 22 | + |
| 23 | + - $("a[name=" + anchor + "]").each( function() { |
| 24 | + - if ( !$(this).parent().parent().hasClass('target-section') ) { |
| 25 | + - console.debug( "Wrapping the target-section" ); |
| 26 | + - $('div.method-detail').unwrap( 'div.target-section' ); |
| 27 | + - $(this).parent().wrap( '<div class="target-section"></div>' ); |
| 28 | + - } else { |
| 29 | + - console.debug( "Already wrapped." ); |
| 30 | + + $("a[name]").each( function() { |
| 31 | + + if ( $(this).attr("name") == anchor ) { |
| 32 | + + if ( !$(this).parent().parent().hasClass('target-section') ) { |
| 33 | + + console.debug( "Wrapping the target-section" ); |
| 34 | + + $('div.method-detail').unwrap( 'div.target-section' ); |
| 35 | + + $(this).parent().wrap( '<div class="target-section"></div>' ); |
| 36 | + + } else { |
| 37 | + + console.debug( "Already wrapped." ); |
| 38 | + + } |
| 39 | + } |
| 40 | + }); |
| 41 | + }; |
| 42 | + |
| 43 | +RDoc 3.9.5, 3.12.1 and RDoc 4.0.0.rc.2 and newer are not vulnerable to this |
| 44 | +exploit. |
| 45 | + |
| 46 | +This exploit was discovered by Evgeny Ermakov <corwmh@gmail.com>. |
| 47 | + |
| 48 | +This vulnerability has been assigned the CVE identifier CVE-2013-0256. |
| 49 | + |
0 commit comments