GHSA-crhg-xgrg-vvcc: @curveball/a12n server SQL Injection Vulnerability
MODERATEGHSA-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
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).
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.
npm install @curveball/a12n-server@0.23.0
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
GHSA-crhg-xgrg-vvcc Affected @curveball/a12n server Versions
1 component(s)| 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?
Which @curveball/a12n server versions are affected?
What version fixes GHSA-crhg-xgrg-vvcc?
Is @curveball/a12n-server affected?
What is the CVSS score of GHSA-crhg-xgrg-vvcc?
What CWE is associated with GHSA-crhg-xgrg-vvcc?
How can I check npm dependencies for GHSA-crhg-xgrg-vvcc?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}