Github found dependency vulnerability in Gemfile.lock
Asked Answered
P

2

7

I have been receiving messages that GitHub found known dependency vulnerability in my Gemfile.lock, this is loofah (2.0.3) and Nokogiri (1.7.0.1) but these gems are dependencies I did not specifically asked for (other gems do depend on them) in my Gemfile, so, what can I do?

Pressey answered 21/3, 2018 at 20:21 Comment(0)
G
7

In your Gemfile.lock, you can see which one of your dependencies pulls in those libraries, and what their version constraint is.

rails-html-sanitizer (1.0.3)
  loofah (~> 2.0)

With Rails, loofah is required by rails-html-sanitizer and the version must just be greater than 2.0. If a version is locked, the Gemfile.lock will read = 2.0.

Since it is not locked, you can use bundle update loofah to install a more recent version that does not suffer from the security vulnerability. Or bundle update if you want to update all gems...

Should a version to locked, you have to check if the gem that declares the dependency has a newer version that updates its locked dependency (e.g. a new version of rails-html-sanitizier that updates loofah). With security issues, these updates normally happen pretty quickly. You would then update rails-html-sanitizier to get a new version of loofah.

Gandzha answered 21/3, 2018 at 22:7 Comment(0)
H
0

You can go into your gemfile.lock and see which libraries are requiring these gems a dependencies. Then you can proceed to update replace or remove those libraries until you no longer have vulnerabilities.

Hulett answered 21/3, 2018 at 21:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.