Skip to content

Commit 99e619c

Browse files
committed
Fix SQL injection vulnerability in tutorial app. Thanks jddj and chrismorgan for pointing it out.
1 parent 86aad1b commit 99e619c

File tree

1 file changed

+2
-2
lines changed
  • examples/coffeesearch/traildepot/scripts

1 file changed

+2
-2
lines changed

examples/coffeesearch/traildepot/scripts/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ addRoute(
1717
`SELECT Owner, Aroma, Flavor, Acidity, Sweetness
1818
FROM coffee
1919
ORDER BY vec_distance_L2(
20-
embedding, '[${aroma}, ${flavor}, ${acid}, ${sweet}]')
20+
embedding, FORMAT("[%f, %f, %f, %f]", $1, $2, $3, $4))
2121
LIMIT 100`,
22-
[],
22+
[+aroma, +flavor, +acid, +sweet],
2323
);
2424
}),
2525
);

0 commit comments

Comments
 (0)