# GHSA-jfwg-rxf3-p7r9: Authorizer: CQL/N1QL Injection in Cassandra and Couchbase Backends via fmt.Sprintf String Interpolation

> Unauthenticated attackers can inject CQL queries via public endpoints to bypass authentication or extract data in Authorizer with Cassandra backend.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Apr 2026
- **Also known as:** GO-2026-5467

## What is GHSA-jfwg-rxf3-p7r9?

GHSA-jfwg-rxf3-p7r9 is a SQL injection vulnerability in github.com/authorizerdev/authorizer, published on 6 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

## Vulnerability Details

**CWE:** CWE-943 - Improper Neutralization of Special Elements in Data Query Logic

All 66+ CQL queries in `internal/storage/db/cassandradb/` use `fmt.Sprintf` to interpolate user-controlled values directly into CQL query strings without parameterization.

Unauthenticated endpoints (`signup`, `login`, `forgot_password`, `magic_link_login`) pass user input directly into CQL query strings.

**Note:** This advisory covers the Cassandra CQL injection only. The Couchbase N1QL injection is tracked in a separate advisory per CVE rule 4.2.11.

## Affected Code Pattern

```go
// Before (VULNERABLE) - e.g. cassandradb/user.go
query := fmt.Sprintf("SELECT ... FROM %s WHERE email = '%s'", table, email)
err := p.db.Query(query).Scan(...)
```

## Steps to Reproduce

1. Deploy Authorizer <= 2.0.0 with Cassandra backend
2. Send a signup request with a CQL injection payload in the email field:

```bash
curl -X POST http://localhost:8080/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"mutation { signup(params: { email: \"test'\" }) { message } }"}'
```

3. The single quote breaks out of the CQL string literal, causing a CQL parse error that leaks internal schema information
4. Crafted payloads can manipulate query logic to bypass authentication or extract data

## Affected Files (10 Cassandra files)

| Package | File | Queries Fixed |
|---------|------|--------------|
| cassandradb | user.go | 7 |
| cassandradb | otp.go | 4 |
| cassandradb | session_token.go | 19 |
| cassandradb | verification_requests.go | 4 |
| cassandradb | authenticator.go | 3 |
| cassandradb | email_template.go | 5 |
| cassandradb | webhook.go | 5 |
| cassandradb | webhook_log.go | 2 |
| cassandradb | session.go | 1 |
| cassandradb | env.go | 2 |

## Impact

An unauthenticated attacker can inject arbitrary CQL operators through the email, phone, or token parameters on public-facing endpoints (signup, login, forgot_password, magic_link_login). This enables authentication bypass and data exfiltration from the Cassandra keyspace.

## Proposed Fix

Use parameterized queries:

```go
// After (FIXED)
query := fmt.Sprintf("SELECT ... FROM %s WHERE email = ?", table)
err := p.db.Query(query, email).Scan(...)
```

Fixed in https://github.com/authorizerdev/authorizer/pull/500 (merged 2026-03-27).

## Which versions are affected by GHSA-jfwg-rxf3-p7r9?

3 open source packages ship an affected version, including github.com/authorizerdev/authorizer.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/authorizerdev/authorizer` | Go | All versions | 0.0.0-20260327055742-73679faa53cd |
| `github.com/authorizerdev/authorizer` | Go | All versions | 0.0.0-20260327055742-73679faa53cd |
| `github.com/authorizerdev/authorizer` | Go | All versions | 0.0.0-20260327055742-73679faa53cd |

## How do I fix GHSA-jfwg-rxf3-p7r9?

Upgrade github.com/authorizerdev/authorizer to 0.0.0-20260327055742-73679faa53cd or later.

## Is GHSA-jfwg-rxf3-p7r9 being exploited?

There is no known exploitation of GHSA-jfwg-rxf3-p7r9 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-jfwg-rxf3-p7r9 and fix it if it is affected.

What it is: GHSA-jfwg-rxf3-p7r9 is a SQL injection vulnerability in github.com/authorizerdev/authorizer, published on 6 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-jfwg-rxf3-p7r9 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/authorizerdev/authorizer (Go): affected all versions; fixed in 0.0.0-20260327055742-73679faa53cd
- github.com/authorizerdev/authorizer (Go): affected all versions; fixed in 0.0.0-20260327055742-73679faa53cd
- github.com/authorizerdev/authorizer (Go): affected all versions; fixed in 0.0.0-20260327055742-73679faa53cd

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-jfwg-rxf3-p7r9/ (Markdown: https://insights.sbomify.com/GHSA-jfwg-rxf3-p7r9/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-jfwg-rxf3-p7r9

---
From sbomify Insights: https://insights.sbomify.com/GHSA-jfwg-rxf3-p7r9/
Summaries are generated and may contain mistakes; the official description above is the record.
