ASD ISM 1276 Use safe database query methods
What it says
Parameterised queries or stored procedures, instead of dynamically generated queries, are used by software for database interactions.
Quoted as published. Everything else on this page is written by Control Stack.
In plain English
Software must reach databases only through parameterised queries or stored procedures, never dynamically generated queries (query text put together while the software runs), whatever goes into them.
Software must use parameterised queries or stored procedures for every database interaction, instead of dynamically generated queries, assembled as text at run time, often with input joined in. A parameterised query has placeholders whose values are passed separately from the query text, so they cannot change the query. A stored procedure is a routine saved in the database and called with parameters. Either is acceptable, but a procedure that builds and runs query text inside itself is still dynamic. The ISM applies this to software the organisation develops or commissions.
Free. Save your status, tasks and notes.
Why it matters
Joining input into query text is what makes SQL injection possible: crafted input rewrites the query, letting a malicious actor read, alter or delete data or reach the database server. With values passed separately, input stays data and cannot change what the query does.
How to implement
Find every query whose text is built from variable data.
Search the code for database calls that join or format strings, including raw-query features of data access libraries, stored procedure calls written as text and AI features that write their own queries. Static application security testing (ISM-0402) can flag many.
Rewrite each as a parameterised query or stored procedure call.
Put a placeholder wherever a value goes and pass the values through the database driver's parameter binding. Call stored procedures with bound parameters too, not by building the call as text. Give AI features fixed parameterised queries to call instead of writing their own.
Check stored procedures for query text built inside them.
A procedure that assembles a query from its parameters and executes it is still a dynamically generated query. Rewrite it with fixed statements that use its parameters directly.
Handle parts that cannot be placeholders.
Table names, column names and sort direction usually cannot be passed as parameters, so write a fixed query for each allowed option and use the input only to choose one. Where a component you cannot change builds queries from text, treat it as a shortfall to fix or replace, not as compliant.
Keep it running
Keep a static analysis rule or code review check that flags any new query whose text is built from variable data, and fail the build on it. Recheck when adopting a new data access library or database, since raw-query features can bring dynamic queries back.
Evidence and audit
- Check 1 of 3What an auditor asks for
Ask for
A static analysis scan and code search of the software's repositories for queries whose text is built from variable data.
Look at
Every database call the scan finds that is not a parameterised query or a stored procedure call with bound parameters.
Good evidence
No database call builds query text from variable data; every call uses placeholders with bound values or calls a stored procedure with bound parameters.
- Check 2 of 3What an auditor asks for
Ask for
The definitions of the stored procedures the software calls, or a sample of them.
Look at
Whether any procedure assembles query text from its parameters and executes it.
Good evidence
No examined stored procedure builds and executes query text from its parameters.
- Check 3 of 3What an auditor asks for
Ask for
A test in which a unique marker value is entered through a sample of inputs, with the database's statement log for that session.
Look at
How the marker reaches the database, using its statement log and, where the driver or the log merges values into the statement text, the code that sends it.
Good evidence
For every sampled input, the marker is bound to a placeholder or a stored procedure parameter, and no code joins it into query text.
Mappings
Closest match in ISO/IEC 27001: A.8.25, Secure development life cycle, which this control partially meets.
ISO/IEC 27001: 2 mappings
This control partially meets A.8.25.
ISM-1276 requires a specific secure implementation pattern for database access: parameterised queries or stored procedures instead of dynamic query generation. Annex A 8.25 requires an organisation to establish and apply rules for secure development of software and systems, under which standards and patterns like safe database query methods would be defined and enforced. ISM-1276 represents one concrete rule that would sit inside the broader secure development rule-set required by Annex A 8.25.
This control partially meets A.8.28.
ISM-1276 requires software to use parameterised queries or stored procedures (rather than dynamically generated queries) for database interactions to prevent injection-style flaws. Annex A 8.28 requires secure coding practices to be applied across software development, which typically includes input handling and preventing injection (including SQL injection) via safe query construction. ISM-1276 is a specific secure-coding requirement focused on database query methods, while Annex A 8.28 is broader and covers many other secure coding topics beyond database access.
Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.




