OWASP / OWASP/ASVS

Enhance ASVS V1.2.4 to address misinterpretation of ORM safety regarding dynamic queries

Open
#3,201 31 comments 0 reactions 2 assignees View on GitHub

Nobody has claimed this yet.

4) proposal for review requires change control
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.