CVE-2025-25226: Joomla/database SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-44v2-prcf-pc3m
CWE-89
Published
Advisory Summary

CVE-2025-25226 is a MODERATE sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Joomla/database libraries in the Packagist ecosystem. The issue involves joomla framework database package vulnerable to sql injection. Remediation is available by upgrading affected packages to version 3.4.0, 2.2.0.

CVE-2025-25226 at a Glance

CVE Identifier CVE-2025-25226
GHSA Identifier GHSA-44v2-prcf-pc3m
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Joomla/database
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2025-25226

To remediate this vulnerability, upgrade all affected Joomla/database dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

joomla/database fixed: 3.4.0
Upgrade joomla/database to 3.4.0
joomla/database fixed: 2.2.0
Upgrade joomla/database to 2.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for joomla/database

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-25226, inspect your project dependencies for Joomla/database:

inspect dependencies for joomla/database

Analyze the terminal output to locate any version of Joomla/database in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.0), 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 Joomla/database, 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

Improper handling of identifiers lead to a SQL injection vulnerability in the quoteNameStr method of the database package. Please note: the affected method is a protected method. It has no usages in the original packages in neither the 2.x nor 3.x branch and therefore the vulnerability in question can not be exploited when using the original database class. However, classes extending the affected class might be affected, if the vulnerable method is used.

CVE-2025-25226 Affected Joomla/database Versions

2 component(s)
Fixed Versions:
3.4.02.2.0
Product / Package Ecosystem Affected Versions Fixed Version
joomla/database
Packagist
≥ 3.0.0
< 3.4.0
3.4.0
joomla/database
Packagist
≥ 1.0.0
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is CVE-2025-25226?
CVE-2025-25226 is a security vulnerability in Joomla/database involving Joomla Framework Database Package Vulnerable to SQL Injection under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Joomla/database versions are affected?
Affected versions include releases prior to 3.4.0, 2.2.0 across affected packages: joomla/database.
What version fixes CVE-2025-25226?
Upgrading to 3.4.0, 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is joomla/database affected?
Yes, joomla/database is affected in releases prior to 3.4.0, 2.2.0. Upgrade your dependency to 3.4.0, 2.2.0 or later.
What CWE is associated with CVE-2025-25226?
CVE-2025-25226 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (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.).
How can I check Packagist dependencies for CVE-2025-25226?
Run the dependency tree command: 'inspect dependencies for joomla/database'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-44v2-prcf-pc3m",
  "modified" : "2025-04-09T13:08:26Z",
  "published" : "2025-04-08T18:34:43Z",
  "aliases" : [ "CVE-2025-25226" ],
  "summary" : "Joomla Framework Database Package Vulnerable to SQL Injection",
  "details" : "Improper handling of identifiers lead to a SQL injection vulnerability in the quoteNameStr method of the database package. Please note: the affected method is a protected method. It has no usages in the original packages in neither the 2.x nor 3.x branch and therefore the vulnerability in question can not be exploited when using the original database class. However, classes extending the affected class might be affected, if the vulnerable method is used.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "joomla/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "joomla/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-25226"
  }, {
    "type" : "WEB",
    "url" : "https://developer.joomla.org/security-centre/963-20250401-framework-sql-injection-vulnerability-in-quotenamestr-method-of-database-package.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/joomla-framework/database"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-09T13:08:26Z",
    "nvd_published_at" : "2025-04-08T17:15:35Z"
  }
}