CVE-2006-7217: Derby SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-v7cq-pq7v-mh5v
CWE-89
Published
Advisory Summary

CVE-2006-7217 is a MODERATE sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Derby libraries in the Maven ecosystem. The issue involves apache derby sql injection. Remediation is available by upgrading affected packages to version 10.2.1.6.

CVE-2006-7217 at a Glance

CVE Identifier CVE-2006-7217
GHSA Identifier GHSA-v7cq-pq7v-mh5v
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 Derby
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2006-7217

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

org.apache.derby:derby fixed: 10.2.1.6
<dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derby</artifactId>
    <version>10.2.1.6</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=org.apache.derby

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2006-7217, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.derby

Analyze the terminal output to locate any version of Derby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.2.1.6), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.derby command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

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 Derby, 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

Apache Derby before 10.2.1.6 does not determine schema privilege requirements during the DropSchemaNode bind phase, which allows remote authenticated users to execute arbitrary drop schema statements in SQL authorization mode.

CVE-2006-7217 Affected Derby Versions

1 component(s)
Fixed Versions:
10.2.1.6
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.derby:derby
Maven
< 10.2.1.6
10.2.1.6

References

Frequently Asked Questions

What is CVE-2006-7217?
CVE-2006-7217 is a security vulnerability in Derby involving Apache Derby SQL Injection under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Derby versions are affected?
Affected versions include releases prior to 10.2.1.6 across affected packages: org.apache.derby:derby.
What version fixes CVE-2006-7217?
Upgrading to 10.2.1.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is derby affected?
Yes, org.apache.derby:derby is affected in releases prior to 10.2.1.6. Upgrade your dependency to 10.2.1.6 or later.
What CWE is associated with CVE-2006-7217?
CVE-2006-7217 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 Maven dependencies for CVE-2006-7217?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.derby'. 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-v7cq-pq7v-mh5v",
  "modified" : "2024-02-12T16:48:29Z",
  "published" : "2022-05-01T07:45:41Z",
  "aliases" : [ "CVE-2006-7217" ],
  "summary" : "Apache Derby SQL Injection",
  "details" : "Apache Derby before 10.2.1.6 does not determine schema privilege requirements during the DropSchemaNode bind phase, which allows remote authenticated users to execute arbitrary drop schema statements in SQL authorization mode.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.derby:derby"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "10.2.1.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2006-7217"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/derby/commit/28c633d82a776c90fd1cd835a0b66d1c8916d31a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/derby"
  }, {
    "type" : "WEB",
    "url" : "https://svn.apache.org/viewvc?view=revision&revision=449869"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20090406213028/http://www.novell.com/linux/security/advisories/suse_security_summary_report.html"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200301122517/https://issues.apache.org/jira/browse/DERBY-1858"
  }, {
    "type" : "WEB",
    "url" : "http://db.apache.org/derby/releases/release-10.2.1.6.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-12T16:48:29Z",
    "nvd_published_at" : "2007-07-05T20:30:00Z"
  }
}