Code Monkey home page Code Monkey logo

Comments (6)

toncid avatar toncid commented on August 15, 2024 5

There is a vulnerability in rubyzip < 1.3: rubyzip/rubyzip#403

from axlsx.

noniq avatar noniq commented on August 15, 2024 4

There’s now a community-supported fork of axlsx: https://github.com/caxlsx/caxlsx

Versions 2.0.2 and 3.0.x have been released, both supporting newer versions of Rubyzip. See https://rubygems.org/gems/caxlsx/versions/3.0.1

from axlsx.

fabdbt avatar fabdbt commented on August 15, 2024 3

By unlock, I do not mean allowing rubyzip versions prior to 1.3. I mean allowing people to use axlsx gem with rubyzip >= 1.3 and so rubyzip >= 2.

from axlsx.

chriscz avatar chriscz commented on August 15, 2024

@Apokly I've had success with the following polyfill on rubyzip == 1.2.1. YMMV.
edit: simplified it, but misread the question. regardless; useful nonetheless.

Place a file ``zip.rb'' as below

lib/
  zip/
    zip.rb

zip.rb

# Polyfill to make AXLSX package work with v1.2.x `zip` which no longer defines `Zip::Zip`
require 'zip'
require 'zip/output_stream'

module Zip
  class ZipOutputStream < OutputStream
    def initialize(filename, stream = false)
      if stream
        filename = StringIO.new
      end
      super(filename, stream)
    end
  end
end

from axlsx.

baburdick avatar baburdick commented on August 15, 2024

Note: there have since been more critical vulnerabilities discovered in rubyzip v1.0.0:

Taking a serious look at https://github.com/caxlsx/caxlsx ...

from axlsx.

noniq avatar noniq commented on August 15, 2024

As far as I understand, both vulnerabilities are in the context of extracting archives. Axlsx only creates archives.

However, it’s a very bad idea to have a vulnerable version of Rubyzip in your project at all, so please upgrade to at least caxlsx 2.0.2 or 3.0.1.

In caxlsx it's also possible to use an external zip program instead of Rubyzip, see https://www.rubydoc.info/gems/caxlsx/Axlsx/Package#serialize-instance_method

from axlsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.