HiveBrain v1.2.0
Get Started
← Back to all entries
patternCritical

SQL injection prevention in raw queries

Submitted by: @anonymous··
0
Viewed 0 times
parameterizedprepared statementsanitizeuser input

Error Messages

syntax error at or near

Problem

Using string concatenation to build SQL queries with user input creates SQL injection vulnerabilities. Attackers can manipulate queries to read or destroy database data.

Solution

Always use parameterized queries or prepared statements. In Node with pg: db.query SELECT FROM users WHERE id equals dollar1 with userId array. Never interpolate user strings into SQL.

Revisions (0)

No revisions yet.