ruby_parser vulnerabilities

ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension). It outputs s-expressions which can be manipulated and converted back to ruby via the ruby2ruby gem. As an example: def conditional1 arg1 return 1 if arg1 == 0 return 0 end becomes: s(:defn, :conditional1, s(:args, :arg1), s(:if, s(:call, s(:lvar, :arg1), :==, s(:lit, 0)), s(:return, s(:lit, 1)), nil), s(:return, s(:lit, 0))) Tested against 801,039 files from the latest of all rubygems (as of 2013-05): * 1.8 parser is at 99.9739% accuracy, 3.651 sigma * 1.9 parser is at 99.9940% accuracy, 4.013 sigma * 2.0 parser is at 99.9939% accuracy, 4.008 sigma * 2.6 parser is at 99.9972% accuracy, 4.191 sigma * 3.0 parser has a 100% parse rate. * Tested against 2,672,412 unique ruby files across 167k gems. * As do all the others now, basically.

Registry
RubyGems
Latest
3.22.0
License
MIT

1 known advisory

The latest version, 3.22.0, is not affected by any of them. Projects on older versions may be.

Update to the latest version:bundle update --conservative ruby_parser # Gemfile: '>= 3.22.0'

Is your project on an affected ruby_parser?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for ruby_parser

  • LowCVE-2013-0162GHSA-8mvw-22r7-w6fq5 May 2022

    ruby_parser allows local users to overwrite arbitrary files via symlink attack on temporary file with predictable name

    Affected
    >=2.0.2 <3.1.2
    Fixed in
    3.1.2

Is your ruby_parser version vulnerable?

Which of your client projects still run an old ruby_parser?

NPMscan reads the Gemfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other RubyGems packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the RubyGems registry.