Skip to content

Commit 8774977

Browse files
committed
Update warning for potentially dangerous queries.
1 parent 94208e1 commit 8774977

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/sync-rules/src/SqlParameterQuery.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ export class SqlParameterQuery {
140140
rows.errors.push(...tools.errors);
141141

142142
if (rows.usesDangerousRequestParameters && !options?.accept_potentially_dangerous_queries) {
143-
let err = new SqlRuleError('Pontially dangerous query based on unauthenticated client parameters', sql);
143+
let err = new SqlRuleError(
144+
"Potentially dangerous query based on parameters set by the client. The client can send any value for these parameters so it's not a good place to do authorization.",
145+
sql
146+
);
144147
err.type = 'warning';
145148
rows.errors.push(err);
146149
}

packages/sync-rules/src/StaticSqlParameterQuery.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export class StaticSqlParameterQuery {
5151
query.errors.push(...tools.errors);
5252

5353
if (query.usesDangerousRequestParameters && !options?.accept_potentially_dangerous_queries) {
54-
let err = new SqlRuleError('Pontially dangerous query based on unauthenticated client parameters', sql);
54+
let err = new SqlRuleError(
55+
"Potentially dangerous query based on parameters set by the client. The client can send any value for these parameters so it's not a good place to do authorization.",
56+
sql
57+
);
5558
err.type = 'warning';
5659
query.errors.push(err);
5760
}

0 commit comments

Comments
 (0)