GitHub Advisoryadvisory · RubyGems
GHSA-w542-cpp9-r3g7 Field Test CSRF vulnerability
MEDIUM
Official page ↗
- Aliases
- CVE-2020-16252
- Ecosystem
- RubyGems
- Packages
- field_test
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
- Weaknesses
- CWE-352
- Reviewed
- 2020-08-05
Affected packages
• RubyGems field_test: >= 0.2.0, < 0.4.0 → fixed in 0.4.0
Description
The Field Test dashboard is vulnerable to cross-site request forgery (CSRF) with non-session based authentication methods in versions v0.2.0 through v0.3.2.
Impact
The Field Test dashboard is vulnerable to CSRF with non-session based authentication methods, like basic authentication. Session-based authentication methods (like Devise's default authentication) are not affected.
A CSRF attack works by getting an authorized user to visit a malicious website and then performing requests on behalf of the user. In this instance, a single endpoint is affected, which allows for changing the variant assigned to a user.
All users running an affected release should upgrade immediately.
Technical Details
Field Test 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. This has been changed to `protect_from_forgery with: :exception`.
Related
Alias · CVE (1)
- CVE-2020-16252 The Field Test gem 0.2.0 through 0.3.2 for Ruby allows CSRF. vulnerability
Weakness · CWE (1)
- CWE-352 Cross-Site Request Forgery weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2020-16252 advisory
- https://github.com/ankane/field_test/issues/28 web
- https://github.com/ankane/field_test/commit/defd3fdf457c22d7dc5b3be7048481947bd5f0d0 web
- https://github.com/ankane/field_test package
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/field_test/CVE-2020-16252.yml web