From 932425d00a76e664e1e94ab46e82ebd407e9a6a6 Mon Sep 17 00:00:00 2001 From: anupamme Date: Thu, 8 Oct 2026 19:16:17 +0000 Subject: [PATCH] fix: multi_agent.cwe-89 security vulnerability Automated security fix generated by OrbisAI Security --- index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 4b42bd7..132ea67 100644 --- a/index.js +++ b/index.js @@ -253,12 +253,16 @@ var PgDriver = Base.extend({ ) .then( function () { - return this.all( - "SELECT table_name FROM information_schema.tables WHERE table_name = '" + - this.internals.migrationTable + - "'" + - (this.schema ? " AND table_schema = '" + this.schema + "'" : '') - ); + var params = [this.internals.migrationTable]; + var sql = + 'SELECT table_name FROM information_schema.tables WHERE table_name = $1'; + + if (this.schema) { + sql += ' AND table_schema = $2'; + params.push(this.schema); + } + + return this.all(sql, params); }.bind(this) ) .then(