Vulnerabilities in pkg:gem/activerecord-jdbc-adapter
PACKAGEGHSA-5qw5-wf2q-f538 is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Activerecord jdbc adapter libraries in the RubyGems ecosystem. The issue involves activerecord-jdbc-adapter (ar-jdbc) lib/arjdbc/jdbc/adapter.rb sql.gsub() function sql injection. Remediation is available by upgrading affected packages to version 1.2.8.
pkg:gem/activerecord-jdbc-adapter
Vulnerability advisories affecting package pkg:gem/activerecord-jdbc-adapter. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5qw5-wf2q-f538 | - | HIGH | ActiveRecord-JDBC-Adapter (AR-JDBC) lib/arjdbc/jdbc/adapter.rb sql.gsub() Function SQL Injection |
GHSA-5qw5-wf2q-f538 at a Glance
How to Fix GHSA-5qw5-wf2q-f538
To remediate this vulnerability, upgrade all affected Activerecord jdbc adapter dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade activerecord-jdbc-adapter to 1.2.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for activerecord-jdbc-adapter
How to Check if You Are Affected
To determine whether your application is affected by GHSA-5qw5-wf2q-f538, inspect your project dependencies for Activerecord jdbc adapter:
inspect dependencies for activerecord-jdbc-adapter
Analyze the terminal output to locate any version of Activerecord jdbc adapter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.8), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Activerecord jdbc adapter, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-5qw5-wf2q-f538 Affected Activerecord jdbc adapter Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
activerecord-jdbc-adapter
|
RubyGems |
< 1.2.8
|
1.2.8
|
References
Frequently Asked Questions
What is GHSA-5qw5-wf2q-f538?
Which Activerecord jdbc adapter versions are affected?
What version fixes GHSA-5qw5-wf2q-f538?
Is activerecord-jdbc-adapter affected?
What CWE is associated with GHSA-5qw5-wf2q-f538?
How can I check RubyGems dependencies for GHSA-5qw5-wf2q-f538?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5qw5-wf2q-f538",
"modified" : "2026-01-21T16:35:36Z",
"published" : "2026-01-16T19:20:40Z",
"aliases" : [ ],
"summary" : "ActiveRecord-JDBC-Adapter (AR-JDBC) lib/arjdbc/jdbc/adapter.rb sql.gsub() Function SQL Injection",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "activerecord-jdbc-adapter"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jruby/activerecord-jdbc-adapter/issues/322"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jruby/activerecord-jdbc-adapter"
}, {
"type" : "WEB",
"url" : "https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/jdbc/adapter.rb"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord-jdbc-adapter/GHSA-5qw5-wf2q-f538.yml"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activerecord-jdbc-adapter/OSVDB-114854.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-16T19:20:40Z",
"nvd_published_at" : null
}
}