ASD ISM 2040 Ensure secure programming practices in software development
What it says
Secure programming practices for the chosen programming language are used for software development.
Quoted as published. Everything else on this page is written by Control Stack.
In plain English
Use secure programming practices written for each programming language the software is built in, not just general secure coding advice.
Software development must use secure programming practices for the programming language chosen. These are coding rules that avoid known weaknesses, and they differ by language because each has its own risky functions and features, such as unsafe string handling, shell command calls or deserialisation (rebuilding objects from received data). General advice alone does not meet the control: each language used, including scripting languages, needs practices specific to it. Code from AI coding assistants is held to the same practices, which ISM-2060 code reviews check.
Free. Save your status, tasks and notes.
Why it matters
Each language has its own ways to introduce vulnerabilities, such as unsafe memory functions in C or unsafe deserialisation in Java. Practices written for the language in use help developers avoid those known weaknesses while writing code, rather than finding them after release.
How to implement
List every programming language in use.
Scan the authoritative source for software (ISM-2023) rather than relying on memory, and include scripting languages and those used only in build or deployment scripts.
Adopt secure programming practices for each language.
Use a recognised secure coding standard for that language, or write one, covering its risky functions and safer alternatives, input and error handling, and use of cryptography. Reference each from the secure software development policy (ISM-2120).
Enforce the rules with automated checks.
Configure linters and static application security testing with rule sets for each language, and run them in the build pipeline, where ISM-2032 requires automated testing to finish without warnings, alerts or errors before software artefacts are built.
Check the practices in code review.
Add each language's rules to the code review checklist (ISM-2060), and hold code from AI coding assistants to the same rules. Where a contractor writes the code, name the practices for each language in the contract and check its static analysis results on delivery.
Keep it running
Update a language's practices when the team adopts a new language, framework or major language version, and when root cause analysis of a vulnerability (ISM-1909) traces it to a coding pattern the practices missed.
Evidence and audit
- Check 1 of 3What an auditor asks for
Ask for
A language breakdown of the authoritative source for software from a scan the auditor runs or watches, with the secure programming practices for each language.
Look at
Whether every language the scan finds has practices written for that language.
Good evidence
Every language the scan finds, including scripting languages, has secure programming practices specific to it, not only a general secure coding policy.
- Check 2 of 3What an auditor asks for
Ask for
The build pipeline configuration and recent results for a sample of repositories.
Look at
Whether language-specific rules run on every change, and whether software artefacts can be built while they report findings.
Good evidence
Language-specific checks run on every change to each sampled repository, and the pipeline does not build software artefacts while they report warnings, alerts or errors (ISM-2032).
- Check 3 of 3What an auditor asks for
Ask for
A sample of recently merged changes, including some made with AI coding assistants, re-read by the auditor against the practices for their language.
Look at
Whether the code avoids the functions and patterns the practices ban and handles input and errors as they require.
Good evidence
The sampled changes follow the practices for their language, with no banned functions or patterns, and changes made with AI assistance meet the same rules as the rest.
Mappings
Closest match in ISO/IEC 27001: A.8.28, Secure coding, which asks for the same thing.
ISO/IEC 27001: 2 mappings
This control is equivalent to A.8.28.
Annex A 8.28 requires secure coding principles to be applied to software development. ISM-2040 directly requires the use of secure programming practices for the chosen programming language during software development, which is the practical expression of secure coding principles. Both controls address the same core requirement, with ISM-2040 providing slightly more implementation specificity (language-specific practices).
This control partially meets A.8.25.
ISM-2040 requires developers to use secure programming practices for the chosen language as part of building software securely. Annex A 8.25 is broader because it requires establishing and applying rules across the secure development lifecycle, which can include governance, design, build, test, release and maintenance practices. Secure programming in ISM-2040 is a key subset of the overall SDL rules expected by Annex A 8.25.
Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.




