/

CVE-2026-121009

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Perl SQL::Abstract -func API

CVE-2026-121009

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

SQL Injection

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SQL::Abstract can skip its documented injection_guard check for function names supplied through the explicit -func form. If an application relies on that guard while passing an untrusted function name through this form, the name may be included in generated SQL without the expected check, enabling SQL injection.

Affected context

The issue affects SQL::Abstract versions from 1.90_01 up to, but not including, 2.000001_04. It arises when an application uses the explicit { -func => [...] } form to generate SQL and expects injection_guard to validate the supplied function name. The documented guard behavior applies to function names, but this form does not pass the name through the check.

Exploit preconditions

  • Attack surface: Application code that builds SQL using SQL::Abstract's -func form
  • Required access: Ability to influence the function name supplied to that code; authentication requirements depend on the application
  • Trigger point: SQL generation using the explicit { -func => [...] } form
  • Why exploitation is possible: The function name is inserted into generated SQL without the expected injection_guard check

Why this happens

This is an inconsistent input-validation path. The -name shorthand applies injection_guard, while the explicit -func form does not apply it to the function name. When an application treats this guard as the security boundary for untrusted input, unchecked SQL construction can result. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • An attacker may alter the structure or behavior of generated SQL.
  • Queries could return, modify, or delete data beyond the application's intended scope.
  • Depending on database permissions and application behavior, unauthorized database operations could occur.

General mitigation guidance

Defensive patterns focus on ensuring that SQL structure is not derived from untrusted input. Use fixed or allowlisted function names, and apply consistent validation to every API form that accepts SQL identifiers or expressions. Prefer parameterized query mechanisms for values, while recognizing that parameters generally do not replace validation for SQL structure such as function names. Limit database-account privileges so a compromised query path has less authority.

How teams detect issues like this

  • Review call sites that construct SQL with -func, especially where function names can be influenced by requests, configuration, or other external input.
  • Use static analysis to identify untrusted data flowing into SQL-construction APIs and checks that apply to one API form but not another.
  • Add code-review checks and policy enforcement for dynamic SQL identifiers, requiring fixed values or explicit allowlists.
  • Test query-generation paths to confirm untrusted function names are rejected or constrained before SQL is constructed.

Sources

SourceLink
github.comgithub.com/dbsrgits/sql-abstract/commit/b6e7d991ac588b937e8943a5b28b6837ff276a51.patch
metacpan.orgmetacpan.org/release/GETTY/SQL-Abstract-2.000001_04/changes

Frequently asked

questions

The issue concerns SQL::Abstract's explicit -func form when an application relies on injection_guard to check the supplied function name.

No particular access level is established by the vulnerability description. Exploitability depends on whether an attacker can influence the function name through the application.

Use fixed or allowlisted function names and ensure validation covers every SQL-construction path that accepts them.

Treat SQL structure as trusted code rather than user data, review data flows into query builders, and enforce consistent validation and least-privilege database access.

Find out what's already
exploitable in your codebase.