Skip to content

Commit

Permalink
api/store: Avoid sql injection on webhook status update
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Apr 23, 2024
1 parent 1e15d91 commit e00130d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/api/src/store/webhook-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class WebhookTable extends Table<DBWebhook> {

async updateStatus(id: string, status: DBWebhook["status"]) {
const res = await this.db.query(
`UPDATE ${
sql`UPDATE ${
this.name
} SET data = jsonb_set(data, '{status}', case when data->'status' is null then '{}' else data->'status' end || '${JSON.stringify(
status
Expand Down

0 comments on commit e00130d

Please sign in to comment.