PgHero gem allows CSRF
Published 5 Aug 2020 · Updated 16 Feb 2024
Is your project on an affected pghero?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <2.7.0
- Fixed in
- 2.7.0
bundle update --conservative pghero # Gemfile: '>= 2.7.0'Details
The PgHero gem through 2.6.0 for Ruby allows CSRF. PgHero normally uses the protect_from_forgery method from Rails to prevent CSRF. However, this defaults to :null_session, which has no effect on non-session based authentication methods. Thus the ruby gem is vulnerable with non-session based authentication methods like basic authentication.
Is GHSA-v6fx-752r-ccp2 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected pghero, and gives you the command that fixes it.
More advisories for pghero
- HighCVE-2023-22626PgHero Allows Information Disclosure Through EXPLAIN Feature · 5 Jan 2023
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.