Enhance ASVS V1.2.4 to address misinterpretation of ORM safety regarding dynamic queries
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 3.6k
- Forks
- 831
- Avg merge
- 7h 55m
- Merged PRs (30d)
- 4
Description
As discussed in https://github.com/OWASP/ASVS/discussions/3193, I am opening this issue to formally track the proposal related to Database Queries.
Following the discussion, here is the final proposal:
1.2.4: Database Queries
The Statement: "Verify that data selection or database queries (e.g., SQL, HQL, NoSQL, Cypher) use parameterized queries, ORMs, entity frameworks, or are otherwise protected from SQL Injection..."
Why it needs explanation: This rule is excellent, but developers often assume that simply using an ORM makes them immune. They fail to understand that injecting user input into methods that construct the query structure itself reintroduces SQL injection.
Recommendation: The explanation should explicitly state: " Verify that data selection or database queries (e.g., SQL, HQL, NoSQL, Cypher) use parameterized queries, ORMs, or entity frameworks. Additionally, ensure that any user input used to construct or modify the structure of a query (e.g., table names, field names, ORDER BY clauses) is validated against a strict allow-list."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.