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

Update Nokogiri gem to a non-vulnerable version. Fixes #278 #279

Merged
merged 6 commits into from
Jul 31, 2017

Conversation

d2bit
Copy link
Contributor

@d2bit d2bit commented Jun 12, 2017

Fixes #278
Updated Nokogiri to > 1.7.1

Test suite run output:

Started
................................................................................................................................................................
..................................................................................................................

Finished in 14.667878 seconds.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
274 tests, 635 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
----------------------------------------------------------------------------------------------------------------------------------------------------------------
18.68 tests/s, 43.29 assertions/s

@josacar
Copy link
Contributor

josacar commented Jun 23, 2017

@bartkamphorst Is there any show stopper to merge this?

@bartkamphorst
Copy link
Member

Yes, there is a test failing on Travis.

@josacar
Copy link
Contributor

josacar commented Jun 23, 2017

@bartkamphorst This is nothing about nokoguiri, it's aboute rouge syntax highlighter:

Installing rouge 2.0.7 (was 2.1.1)

and then

Installing rouge 2.0.7 (was 2.1.1)
Using gollum-lib 4.2.5 from source at `.`
Bundle updated!
~/code/gollum-lib (master)$ be ruby test/test_markup.rb
Loaded suite test/test_markup
Started
.................................................................................................

Finished in 4.821316 seconds.
---------------------------------------------------------------------------------------------------------------------------------------------------------
97 tests, 168 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------------------------------------------------------------------------
20.12 tests/s, 34.85 assertions/s

Should we update specs or should we pin rouge gem to 2.0.7 ?

Thanks in advance.

@d2bit
Copy link
Contributor Author

d2bit commented Jun 26, 2017

@josacar good catch! I was not able to reproduce the error, as my Gemfile.lock pointed to 2.0.7.
@bartkamphorst I think master builds are red now. Do you prefer to pin rouge version, or to update the specs?

@bartkamphorst
Copy link
Member

@d2bit @josacar I prefer updating the spec. 👍 Thanks for working on this!

@josacar
Copy link
Contributor

josacar commented Jun 26, 2017

@bartkamphorst Everything green but MRI 2.0 and JRuby

@bartkamphorst
Copy link
Member

I hadn't realized that nokogiri 1.7 requires Ruby version >= 2.1.0. This breaks backwards compatibility. @dometto What do you suggest we do? Release a minor release or include this fix only in 5.x? Given the security risk I think having the in 4.X makes some sense.

@josacar
Copy link
Contributor

josacar commented Jun 27, 2017

Maybe we can relax Nokogiri dependency to < 2.0 in 4.x branch and let everyone choose to stay updated or run with an EOL version and vulnerable. What do you think?

@dometto
Copy link
Member

dometto commented Jun 28, 2017

@josacar good suggestion. If it means breaking the MRI < 2.1.0 test on Travis, I say we just remove that.

@josacar
Copy link
Contributor

josacar commented Jun 28, 2017

Tried loosing the dependency to < 2.0, but rubygems still requires latest compatible version although it's not compatible with the MRI version.

@josacar
Copy link
Contributor

josacar commented Jul 18, 2017

@dometto @bartkamphorst I've modified the gemspec to make MRI 2.0 pass on CI, Jruby is still failing due to a dependency is missing

@josacar
Copy link
Contributor

josacar commented Jul 18, 2017

New JGit requires Java 8, fixed in travis

@dometto dometto changed the title Update Nokogiri gem to a non-vulnerable version Update Nokogiri gem to a non-vulnerable version. Fixes #278 Jul 31, 2017
@dometto
Copy link
Member

dometto commented Jul 31, 2017

Sorry for the wait, I was away for a bit. Merging this now. I'll also bump the gem.

@dometto dometto merged commit 2b1a15d into gollum:master Jul 31, 2017
@dometto
Copy link
Member

dometto commented Jul 31, 2017

@josacar just FYI: I overlooked this, but the if statement in gemspec.rb doesn't work as you might expect. As the code is only evaluated on build-time (i.e., when running gem build), the right nokogiri version is not required dynamically. Rather, you just end up with a different gem depending on which version of ruby you're using. This had the effect of breaking ruby 2.0.0 support for the gollum gem. No big problem, as I think we should just decontinue support for that ruby, seeing as it's not compatible with a safe version of nokogiri. But I just wanted to give you a heads up about this annoying feature of ruby Gemfiles.

@josacar
Copy link
Contributor

josacar commented Aug 1, 2017

Ok, my bad. We can still do a `nokogiri "~> 1.6" and do the if statement to make CI pass, and let users update to latest nokogiri whilst letting users use an unsafe nokogiri version. What do you think?

@josacar
Copy link
Contributor

josacar commented Aug 1, 2017

In fact, if you're building with > 2.0 it should happen nothing, as it requires >= 1.6.1

@dometto
Copy link
Member

dometto commented Aug 1, 2017

I actually think it is ok to make installation on 2.0 fail so nobody uses a vulnerable gem by accident. Currently gollum-lib depends on nokogiri v1.8, but a gem install gollum will still work because it will require an older gollum-lib. I think the thing to do is bump the gollum gem and make it depend strictly on the latest, non-vulnerable gollum-lib.

@bartkamphorst
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants