# GHSA-5QW5-WF2Q-F538: ActiveRecord-JDBC-Adapter (AR-JDBC) lib/arjdbc/jdbc/adapter.rb sql.gsub() Function SQL Injection

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2026-01-16
- Modified: 2026-02-03

## Affected versions

- activerecord-jdbc-adapter (RubyGems): fixed in 1.2.8

## Description

ActiveRecord-JDBC-Adapter (AR-JDBC) contains a flaw that may allow carrying out an SQL injection attack. The issue is due to the sql.gsub() function in lib/arjdbc/jdbc/adapter.rb not properly sanitizing user-supplied input before using it in SQL queries. This may allow a remote attacker to inject or manipulate SQL queries in the back-end database, allowing for the manipulation or disclosure of arbitrary data.

## References

- https://github.com/jruby/activerecord-jdbc-adapter/issues/322
- https://github.com/jruby/activerecord-jdbc-adapter
- https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/jdbc/adapter.rb
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord-jdbc-adapter/GHSA-5qw5-wf2q-f538.yml
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord-jdbc-adapter/OSVDB-114854.yml

Page: https://cve.now/GHSA-5QW5-WF2Q-F538

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
