TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

When parameterization fails: SQL injection in Nim using parameterized queries

20 pointsby xx_nsabout 2 months ago

1 comment

jiggawattsabout 2 months ago
That’s… not parameterization the way most people understand it. It’s text templating, which is different and fraught with risk as the OP discovered.<p>For comparison: the Microsoft SQL client code will <i>not</i> substitute an escaped version of the query parameters into the query text! It sends the query with the named placeholders first, and then the parameter values encoded <i>separately</i> so that there’s zero risk of this kind of thing happening.<p>Also, this makes it trivial for the database engine to cache each query independently of the specific query parameter values.
评论 #43564746 未加载
评论 #43562671 未加载