GHSA-crhg-xgrg-vvcc: @curveball/a12n server SQL Injection Vulnerability

MODERATE
CVSS 6.5
CWE-89
Published
Advisory Summary

GHSA-crhg-xgrg-vvcc is a MODERATE (CVSS 6.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting @curveball/a12n server libraries in the npm ecosystem. The issue involves a12nserver vulnerable to potential sql injections via knex dependency. Remediation is available by upgrading affected packages to version 0.23.0.

GHSA-crhg-xgrg-vvcc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-crhg-xgrg-vvcc
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product @curveball/a12n server
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-crhg-xgrg-vvcc

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

@curveball/a12n-server fixed: 0.23.0
npm install @curveball/a12n-server@0.23.0
Verify Direct and Transitive Dependencies

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

npm ls @curveball/a12n-server

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-crhg-xgrg-vvcc, inspect your project dependencies using npm:

npm ls @curveball/a12n-server

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

Note: The npm ls @curveball/a12n-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

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 @curveball/a12n server, 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

### Impact Users of a12nserver that use MySQL might be vulnerable to SQL injection bugs. If you use a12nserver and MySQL, update as soon as possible. This SQL injection bug might let an attacker obtain OAuth2 Access Tokens for users unrelated to those that permitted OAuth2 clients. ### Patches The knex dependency has been updated to 2.4.0 in a12nserver 0.23.0 ### Workarounds No further workarounds ### References * https://github.com/knex/knex/issues/1227 * https://nvd.nist.gov/vuln/detail/CVE-2016-20018 * https://www.ghostccamm.com/blog/knex_sqli/

GHSA-crhg-xgrg-vvcc Affected @curveball/a12n server Versions

1 component(s)
Fixed Versions:
0.23.0
Product / Package Ecosystem Affected Versions Fixed Version
@curveball/a12n-server
npm
≥ 0.20.0
< 0.23.0
0.23.0

References

Frequently Asked Questions

What is GHSA-crhg-xgrg-vvcc?
GHSA-crhg-xgrg-vvcc is a security vulnerability in @curveball/a12n server involving a12nserver vulnerable to potential SQL Injections via Knex dependency under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which @curveball/a12n server versions are affected?
Affected versions include releases prior to 0.23.0 across affected packages: @curveball/a12n-server.
What version fixes GHSA-crhg-xgrg-vvcc?
Upgrading to 0.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @curveball/a12n-server affected?
Yes, @curveball/a12n-server is affected in releases prior to 0.23.0. Upgrade your dependency to 0.23.0 or later.
What is the CVSS score of GHSA-crhg-xgrg-vvcc?
GHSA-crhg-xgrg-vvcc has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with GHSA-crhg-xgrg-vvcc?
GHSA-crhg-xgrg-vvcc 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 npm dependencies for GHSA-crhg-xgrg-vvcc?
Run the dependency tree command: 'npm ls @curveball/a12n-server'. 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-crhg-xgrg-vvcc",
  "modified" : "2023-01-13T21:34:29Z",
  "published" : "2023-01-13T21:34:29Z",
  "aliases" : [ ],
  "summary" : "a12nserver vulnerable to potential SQL Injections via Knex dependency",
  "details" : "### Impact\n\nUsers of a12nserver that use MySQL might be vulnerable to SQL injection bugs. \n\nIf you use a12nserver and MySQL, update as soon as possible. This SQL injection bug might let an attacker obtain OAuth2 Access Tokens for users unrelated to those that permitted OAuth2 clients.\n\n### Patches\n\nThe knex dependency has been updated to 2.4.0 in a12nserver 0.23.0\n\n### Workarounds\n\nNo further workarounds\n\n### References\n\n* https://github.com/knex/knex/issues/1227\n* https://nvd.nist.gov/vuln/detail/CVE-2016-20018\n* https://www.ghostccamm.com/blog/knex_sqli/\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@curveball/a12n-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.20.0"
      }, {
        "fixed" : "0.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/curveball/a12n-server/security/advisories/GHSA-crhg-xgrg-vvcc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-20018"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/knex/knex/issues/1227"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/curveball/a12n-server/commit/f4acd7549043e6e2b8917b77a50dce0756a922cc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/curveball/a12n-server"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/curveball/a12n-server/releases/tag/v0.23.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.ghostccamm.com/blog/knex_sqli"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-13T21:34:29Z",
    "nvd_published_at" : "2023-01-13T16:15:00Z"
  }
}