# GHSA-5qw5-wf2q-f538: ActiveRecord-JDBC-Adapter (AR-JDBC) lib/arjdbc/jdbc/adapter.rb sql.gsub() Function SQL Injection

> Remote attackers can inject SQL via unsanitized input in the ActiveRecord-JDBC-Adapter, leading to data manipulation or disclosure.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not stated
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Jan 2026

## What is GHSA-5qw5-wf2q-f538?

GHSA-5qw5-wf2q-f538 is a SQL injection vulnerability in activerecord-jdbc-adapter, published on 16 Jan 2026. It can be exploited over the network, with no action from the victim.

### Official 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.

## Which versions are affected by GHSA-5qw5-wf2q-f538?

2 open source packages ship an affected version, including activerecord-jdbc-adapter.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `activerecord-jdbc-adapter` | RubyGems | All versions | 1.2.8 |
| `activerecord-jdbc-adapter` | RubyGems | All versions | 1.2.8 |

## How do I fix GHSA-5qw5-wf2q-f538?

Upgrade activerecord-jdbc-adapter to 1.2.8 or later.

## Is GHSA-5qw5-wf2q-f538 being exploited?

There is no known exploitation of GHSA-5qw5-wf2q-f538 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-5qw5-wf2q-f538 and fix it if it is affected.

What it is: GHSA-5qw5-wf2q-f538 is a SQL injection vulnerability in activerecord-jdbc-adapter, published on 16 Jan 2026. It can be exploited over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-5qw5-wf2q-f538 in the wild and no public exploit code.

Affected packages and fixed versions:
- activerecord-jdbc-adapter (RubyGems): affected all versions; fixed in 1.2.8
- activerecord-jdbc-adapter (RubyGems): affected all versions; fixed in 1.2.8

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-5qw5-wf2q-f538/ (Markdown: https://insights.sbomify.com/GHSA-5qw5-wf2q-f538/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-5qw5-wf2q-f538

---
From sbomify Insights: https://insights.sbomify.com/GHSA-5qw5-wf2q-f538/
Summaries are generated and may contain mistakes; the official description above is the record.
