🙏
github: github.com/mensfeld
www: mensfeld.pl
twitter: @maciejmensfeld
e-mail: maciej@mensfeld.pl
RubyGems is a package manager for the Ruby programming language.
Development of RubyGems started in November 2003 and was released to the public on March 14, 2004, or Pi Day 2004.
It was created by Chad Fowler and Richard Kilmer during RubyConf 2004
Please watch my Taking over a Ruby gem RubyKaigi 2019 presentation for live examples.
Not all of the risks are connected with malicious activities though.
Typosquatting, is a form of cybersquatting which relies on mistakes such as typos made by users when inputting a name.https://en.wikipedia.org/wiki/Typosquatting
and over 700 more
diff --git a/.ruby-version b/.ruby-version
index ecd7ee5..8e8299d 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.5.8
+2.4.2
diff --git a/damerau-levenshtein.gemspec b/damerau-levenshtein.gemspec
- s.required_ruby_version = ">= 2.5"
- s.name = "damerau-levenshtein"
+ s.required_ruby_version = ">= 2.4"
+ s.name = "damerau-levenstein"
- s.homepage = "https://github.com/GlobalNamesArchitecture/damerau-levenshtein"
+ s.homepage = "https://github.com/DarkWater666/damerau-levenshtein"
- s.add_development_dependency "activesupport", "~> 6.0"
- s.add_development_dependency "bundler", "~> 2.1"
- s.add_development_dependency "byebug", "~> 11.0"
+ s.add_development_dependency "activesupport", "~> 4.2"
+ s.add_development_dependency "bundler", "~> 2.0"
diff --git a/lib/damerau-levenshtein/version.rb b/lib/damerau-levenshtein/version.rb
- VERSION = "1.3.3"
+ VERSION = "1.3.3.1"
http://gavinmiller.io/2020/how-i-mitmd-rubygems-org-kinda/
Similar example but related to bitsquatting can be found in my Taking over a Ruby gem presentation from 2019.
There are:
Amongst those with more than 100 000 downloads
The event-stream module was originally by Dominic Tarr, who maintained the library before handing it to a contributor. Tarr indicated that he has not used the module and transferred its ownership after he received an email regarding its maintenance.
https://dgb.github.io/2019/04/05/bootstrap-sass-backdoor.html
- I couldn’t find 3.2.0.3 in the GitHub repo
- I couldn’t find any mention of the version in any issues or changelogs
- I couldn’t find any mention of the gem being yanked by the owners of the project
Account takeover is a form of identity theft and fraud, where a malicious third party successfully gains access to a user's account credentials.
rest-client 1.6.13
https://my.diffend.io/gems/rest-client/1.6.9/1.6.13/page/1#d2h-017072-851
Luckily for us, this one is going to be tackled in the upcoming weeks.
💪
This one is funny, because it's... accidental.
{
"data/config/access_token.txt.enc": {
"family": "application",
"full": "application/x-dosexec"
}
}
Huge subject on it's own so let's focus on one case:
What if I told you, that what you've uploaded to RubyGems month ago and what is being served right now are two different things?
There is always a possibility, that RubyGems is going to be hacked and that some of the gems content is going to be replaced.
Yoshitaka Sakurada, the minister for cybersecurity who recently confessed that he does not use computers, has now told a Diet committee that he is not very familiar with cybersecurity issues.
source 'https://rubуgems.org'
'у'.bytes => [209, 131]
vs
source 'https://rubygems.org'
'y'.bytes => [121]
IDN homograph attack
Unless a license that specifies otherwise is included, nobody else can use, copy, distribute, or modify that library without being at risk of take-downs, shake-downs, or litigation.
rm Gemfile.lock
bundle
bundle exec rspec spec
git add ./
git commit -m "gem bump"
git push origin master
vs
bundle outdated
bundle update XYZ
bundle exec rspec spec
git add ./
git commit -m "gem bump"
git push origin master
ENV.map { |a, v| [a,v] }.to_s
OSS supply chain security and management platform for Ruby applications
that is free :)
Diffend aims to analyze releases packages to find vulnerabilities and quality problems
Plan is to improve the ecosystem of gems releases, the same way we improve our code.
https://diffend.io/docs
ruby <(curl -s https://my.diffend.io/api/setup/ruby)
# or
curl https://my.diffend.io/api/setup/ruby \
-o /tmp/install.rb; \
ruby /tmp/install.rb
We're working on building a sandbox with modified MRI to analyze the system behaviour with new gems released.