Sha256: 25edf4ecc1abcee250e6322d9ca396423f55659e627ec0b0bba5164defaed345

Contents?: true

Size: 1.9 KB

Versions: 88

Compression:

Stored size: 1.9 KB

Contents

= RDoc 2.3.0 through 3.12 XSS Exploit

RDoc documentation generated by rdoc 2.3.0 through rdoc 3.12 and prereleases up
to rdoc 4.0.0.preview2.1 are vulnerable to an XSS exploit.  This exploit may
lead to cookie disclosure to third parties.

The exploit exists in darkfish.js which is copied from the RDoc install
location to the generated documentation.

RDoc is a static documentation generation tool.  Patching the library itself
is insufficient to correct this exploit.  Those hosting rdoc documentation will
need to apply the following patch.  If applied while ignoring whitespace, this
patch will correct all affected versions:

  diff --git darkfish.js darkfish.js
  index 4be722f..f26fd45 100644
  --- darkfish.js
  +++ darkfish.js
  @@ -109,13 +109,15 @@ function hookSearch() {
   function highlightTarget( anchor ) {
     console.debug( "Highlighting target '%s'.", anchor );
   
  -  $("a[name=" + anchor + "]").each( function() {
  -    if ( !$(this).parent().parent().hasClass('target-section') ) {
  -      console.debug( "Wrapping the target-section" );
  -      $('div.method-detail').unwrap( 'div.target-section' );
  -      $(this).parent().wrap( '<div class="target-section"></div>' );
  -    } else {
  -      console.debug( "Already wrapped." );
  +  $("a[name]").each( function() {
  +    if ( $(this).attr("name") == anchor ) {
  +      if ( !$(this).parent().parent().hasClass('target-section') ) {
  +        console.debug( "Wrapping the target-section" );
  +        $('div.method-detail').unwrap( 'div.target-section' );
  +        $(this).parent().wrap( '<div class="target-section"></div>' );
  +      } else {
  +        console.debug( "Already wrapped." );
  +      }
       }
     });
   };

RDoc 3.9.5, 3.12.1 and RDoc 4.0.0.rc.2 and newer are not vulnerable to this
exploit.

This exploit was discovered by Evgeny Ermakov <corwmh@gmail.com>.

This vulnerability has been assigned the CVE identifier CVE-2013-0256.

Version data entries

88 entries across 84 versions & 13 rubygems

Version Path
rdoc-6.8.1 CVE-2013-0256.rdoc
rdoc-6.8.0 CVE-2013-0256.rdoc
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rdoc-6.7.0/CVE-2013-0256.rdoc
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/rdoc-6.7.0/CVE-2013-0256.rdoc
rdoc-6.6.3.1 CVE-2013-0256.rdoc
rdoc-6.5.1.1 CVE-2013-0256.rdoc
rdoc-6.4.1.1 CVE-2013-0256.rdoc
rdoc-6.3.4.1 CVE-2013-0256.rdoc
rdoc-6.6.2 CVE-2013-0256.rdoc
rdoc-6.6.1 CVE-2013-0256.rdoc
rdoc-6.6.0 CVE-2013-0256.rdoc
rdoc-6.5.0 CVE-2013-0256.rdoc
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/rdoc-6.4.0/CVE-2013-0256.rdoc
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/rdoc-6.4.0/CVE-2013-0256.rdoc
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/rdoc-6.4.0/CVE-2013-0256.rdoc
rdoc-6.4.0 CVE-2013-0256.rdoc
rdoc-6.3.3 CVE-2013-0256.rdoc
rdoc-6.1.2.1 CVE-2013-0256.rdoc
rdoc-6.3.2 CVE-2013-0256.rdoc
gitlab-rdoc-6.3.2 CVE-2013-0256.rdoc