Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Issue : invalid permission on ruby files #1

Open
fwininger opened this issue Oct 24, 2019 · 0 comments

Comments

@fwininger
Copy link

@fwininger fwininger commented Oct 24, 2019

Hi,

This gem has world writable files in the release 1.0.0.

how to reproduce the issue

find . -xdev -type f -perm -0002

./ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb
./ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex
./ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb
./ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser_extras.rb
./ruby_parser-legacy-1.0.0/test/ruby_parser/test_ruby_parser.rb
./ruby_parser-legacy-1.0.0/test/ruby_parser/test_legacy.rb
./ruby_parser-legacy-1.0.0/test/ruby_parser/test_ruby_lexer.rb
./ruby_parser-legacy-1.0.0/test/ruby_parser/test_ruby_parser_extras.rb

exploitation poc

add in ./ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb

puts "Code execution with : #{%x(id)}"

require the gem in a other projet may run the shell code with the user privilege.

$ brakeman
Loading scanner...
Code execution with : uid=1000(xxxx) gid=1000(xxxx) groups=1000(xxxx)
Please supply the path to a Rails application (looking in /home/xxxx/).

Please release a new release asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.