ISO 27001 Annex A 8.28 Secure coding
What it says
Secure coding principles shall be applied to software development.
Quoted as published. Everything else on this page is written by Control Stack.
In plain English
Apply secure coding principles to software development, in-house or outsourced, to reduce flaws such as unchecked input and hard-coded passwords.
Your organisation must apply secure coding principles to its software development. Secure coding principles are rules for writing software that reduce exploitable flaws. Examples are checking all input, never writing passwords into code, and using proven components for login and cryptography. The principles apply to new and reused code and scripts, to how you choose and maintain third-party libraries and, through the contract, to software a supplier develops for you. If you only buy finished software, they apply only to scripts, automations or changes you make to it.
Free. Save your status, tasks and notes.
Why it matters
Attackers look for flaws such as database injection (input run as a command) and cross-site scripting (input run in another user's browser), which come from how code is written. Applying secure coding principles means fewer flaws reach live systems, where they are harder to fix.
How to implement
List the software you develop and who writes it.
Include applications, scripts, low-code automations and contractor work. If you genuinely write nothing, record that in your Statement of Applicability (the list of which controls apply and why), and handle bought software through Annex A 8.26, which covers security requirements when acquiring applications.
Set a secure coding baseline for all software you develop.
For each language in use, list the rules: check all input, use parameterised database queries, keep passwords and keys out of code, check access on every request, and log errors without exposing sensitive data. Base them on the language and tool vendors' own security guidance.
Build the rules into developer tools and code review.
Configure code editors to flag unsafe patterns. Run static application security testing (SAST, which scans source code for known flaw patterns) and a scan for stored passwords and keys on each change. Require a reviewer other than the author, and block merges while findings above your agreed severity remain open.
Manage third-party and open source components.
Keep an inventory of libraries and versions for each application, using a dependency scanner to build it and flag known vulnerabilities. Take components from reputable, maintained sources, keep them updated, and use proven ones for login and cryptography instead of writing your own.
Extend the principles to code you do not write yourselves.
Put them in supplier contracts and ask for scan results with each delivery (Annex A 8.30 covers directing outsourced work). Before modifying a bought package, ask the vendor whether it can make the change as a standard update, because otherwise future maintenance may fall to you.
Keep it running
Update the rules and tool settings when a new kind of flaw appears in your code or in published advice, or when you adopt a new language or framework. Annex A 8.8 covers vulnerabilities in software already running.
Evidence and audit
- Check 1 of 5What an auditor asks for
Ask for
The list of software you develop, including scripts, automations and contractor work, matched to source control and the scanning tool's project list.
Look at
Whether every application, script collection, automation and contractor project in active development is covered by the secure coding checks.
Good evidence
Everything in active development is covered by the secure coding checks, apart from a few named exceptions that each have a recorded reason and an owner.
- Check 2 of 5What an auditor asks for
Ask for
A sample of recently merged changes, with their review and scan results, plus the merge protection settings.
Look at
Whether someone other than the author reviewed each change, whether scans ran before merging, and whether an administrator can bypass the rule unnoticed.
Good evidence
Each sampled change was reviewed by someone other than its author and scanned before merging, and any bypass leaves a record that someone checks.
- Check 3 of 5What an auditor asks for
Ask for
A search of current source code for patterns the rules prohibit, such as hard-coded passwords and unsafe functions.
Look at
Whether the principles are applied in real code, not only in a written standard.
Good evidence
The search finds none of the prohibited patterns, or each finding has an owner and a fix under way.
- Check 4 of 5What an auditor asks for
Ask for
The component inventory for one application, compared with a dependency scan of its latest build.
Look at
Components missing from the inventory, outdated versions and components from unmaintained or unknown sources.
Good evidence
The inventory matches the scan, and each component that is outdated, unmaintained, of unknown source or known to be vulnerable has a fix or a recorded decision.
- Check 5 of 5What an auditor asks for
Ask for
A development contract and the supplier's evidence for its latest delivery.
Look at
Whether the contract requires secure coding principles, and whether the evidence relates to the version delivered.
Good evidence
The contract states the principles and the evidence covers the delivered version, with findings fixed or accepted before go-live.
Mappings
Closest match in ASD Information Security Manual: ISM-2040, Ensure secure programming practices in software development, which asks for the same thing.
ASD Information Security Manual: 34 mappings
This control is equivalent to ISM-2040.
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 is broader than ISM-0938.
ISM-0938 requires organisations to select user application vendors that demonstrate Secure by Design/Secure by Default, including secure programming practices and use of memory-safe languages. ISO/IEC 27001:2022 Annex A 8.28 mandates secure coding principles in software development, which ISM-0938 expects vendors to follow. Annex A 8.28 focuses on development practices, while ISM-0938 focuses on procurement based on these practices.
This control is broader than ISM-1239.
Annex A 8.28 covers the application of secure coding principles across software development. ISM-1239 falls inside that scope for one class of software, requiring robust web application frameworks in the development of web applications, since such frameworks carry safer defaults for input handling, output encoding and session management. Annex A 8.28 applies to all software development, not only web applications.
This control is broader than ISM-1241.
ISM-1241 requires that output encoding is performed on all output produced by web applications to prevent injection-style client-side attacks (e.g. XSS). Annex A 8.28 requires secure coding practices to be applied across software development, which commonly includes output encoding/escaping in web applications. ISM-1241 is a specific secure coding requirement focused on web output handling, while Annex A 8.28 is broader and covers many additional coding practices beyond output encoding.
This control is broader than ISM-1275.
ISM-1275 requires that all software-to-database queries are filtered/validated for legitimate content and correct syntax (i.e., query input validation to prevent malformed or malicious queries). Annex A 8.28 requires secure coding principles to be applied across software development, which includes practices such as input validation, parameterised queries, and defensive coding against injection. ISM-1275 is a specific secure coding requirement focused on database query construction and validation, whereas Annex A 8.28 is broader across all coding areas.
This control is broader than ISM-1276.
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.
This control is broader than ISM-1278.
ISM-1278 requires software to avoid exposing database structure details through error messages. This maps to Annex A 8.28 because secure coding practices commonly include controlling exception handling, sanitising error outputs, and preventing information disclosure that could aid attackers. Annex A 8.28 applies broadly to coding principles across the application, whereas ISM-1278 is a targeted requirement specifically about database-related error information.
This control is broader than ISM-1849.
Annex A 8.28 covers the application of secure coding principles across software development. ISM-1849 sits inside that scope as one prescriptive instance, requiring the OWASP Top 10 Proactive Controls to be used in the development of web applications. Annex A 8.28 leaves the choice of standard open and applies to software of every kind.
This control is broader than ISM-1850.
ISM-1850 requires that web application development mitigates the OWASP Top 10 security risks. ISO/IEC 27001:2022 Annex A 8.28 requires secure coding principles to be applied to software development, which directly contributes to preventing many OWASP Top 10 issues (e.g. injection, insecure design and identification/authentication weaknesses). Annex A 8.28 is broader because it applies to all software development and does not enumerate the OWASP Top 10 specifically.
This control is broader than ISM-1851.
Annex A 8.28 covers applying secure coding principles to software development. ISM-1851 is one specific case inside that scope, mitigating the OWASP API Security Top 10 in the development of web APIs. Annex A 8.28 applies to all software an organisation develops, with web API work and that named list of risks forming one part.
This control is broader than ISM-1922.
Annex A 8.28 covers secure coding principles applied to software development of every kind. ISM-1922 is one specific case within that scope, naming the OWASP Mobile Application Security Verification Standard as the basis for developing mobile applications, which turns broad principles into testable requirements for common mobile risks.
This control is broader than ISM-2016.
ISM-2016 requires validation and sanitisation to be performed on all input received over a local network by software. ISO/IEC 27001:2022 Annex A 8.28 requires secure coding principles to be applied to software development, which would typically include input validation and sanitisation as a core secure coding practice. Annex A 8.28 is broader because it covers many secure coding principles beyond input handling, while ISM-2016 is specifically focused on the control to prevent input-driven vulnerabilities.
This control is broader than ISM-2030.
ISM-2030 requires scanning during commits to detect and block plaintext or encoded secrets/keys from being committed to the authoritative repository. Annex A 8.28 requires secure coding principles to be applied during software development, which commonly includes avoiding hard-coded credentials and implementing controls (such as pre-commit hooks/CI checks) to prevent credential leakage. ISM-2030 is a concrete technical enforcement mechanism for one secure coding outcome (no secrets in code), whereas Annex A 8.28 covers a wider set of secure coding principles beyond secret management.
This control is broader than ISM-2031.
ISM-2031 requires organisations to implement and use build-tool security features (e.g. compiler/linker hardening, pipeline protections) to strengthen executable security. ISO/IEC 27001:2022 Annex A 8.28 requires secure coding principles to be applied in software development, and hardened compilation/build settings reduce the impact of coding errors (such as memory corruption) by adding exploit mitigations. Annex A 8.28 primarily addresses how code is written, while ISM-2031 addresses how software is built and packaged into executables.
This control is broader than ISM-2041.
Annex A 8.28 requires secure coding principles to be applied across software development. ISM-2041 overlaps by requiring memory-safe programming languages or (less preferably) memory-safe programming practices, which are specific secure coding choices to reduce memory corruption vulnerabilities. ISM-2041 is narrower and technology-specific, while Annex A 8.28 covers secure coding more broadly.
This control is broader than ISM-2057.
ISM-2057 requires documented input validation rules that are implemented in code and verified through positive and negative unit or integration tests. Annex A 8.28 requires secure coding principles to be applied across software development, within which input validation and associated testing are core secure coding practices. ISM-2057 is more specific (input validation documentation-to-code traceability and test coverage) while Annex A 8.28 is broader across many secure coding topics.
This control is broader than ISM-2058.
ISM-2058 requires that data sources and serialised data inputs are validated before being deserialised to prevent malformed or malicious payloads being processed. This relates to Annex A 8.28 because input validation and safe handling of untrusted data (including deserialisation) are core secure coding principles applied during software development. Annex A 8.28 is broader, covering many secure coding practices beyond deserialisation-specific validation (e.g. authentication, authorisation, error handling and cryptographic misuse prevention).
This control is broader than ISM-2059.
Annex A 8.28 covers secure coding principles across software development. ISM-2059 is one specific application of those principles, restricting file uploads or input to nominated file types and scanning for malicious content before a file is accessed, executed or stored. Annex A 8.28 reaches every other coding practice, from input validation through to error handling.
This control is broader than ISM-2060.
Annex A 8.28 covers applying secure coding principles to software development. ISM-2060 is one specific practice inside that scope, using code reviews to confirm that software components meet Secure by Design principles and practices as well as secure programming practices. Annex A 8.28 covers the whole of secure coding, of which review is one way of putting the principles into effect.
This control is broader than ISM-2064.
ISM-2064 requires that web application session cookies contain only digitally signed opaque bearer tokens to prevent tampering. Annex A 8.28 mandates applying secure coding principles, which would include correctly implementing tamper-resistant session management (e.g. signed tokens/cookies). ISM-2064 is a specific technical pattern for cookies, while Annex A 8.28 is broader across all coding practices and defect classes.
This control is broader than ISM-2066.
ISM-2066 requires web application sessions to be centrally managed server side to reduce risks such as session tampering and weak client-side session storage. Annex A 8.28 requires secure coding principles to be applied, which commonly includes secure session management design and implementation patterns. ISM-2066 is a concrete secure session management outcome, while Annex A 8.28 is broader and covers many other secure coding concerns beyond sessions.
This control is broader than ISM-2085.
ISM-2085 requires organisations to prevent exposing exact AI model confidence scores in APIs and user interfaces. Annex A 8.28 requires secure coding practices, which would typically include designing API/UI responses to avoid leaking sensitive or security-relevant information such as exact confidence values. The ISO control is broader and applies to all secure coding concerns, while ISM-2085 is a specific secure-by-design output-handling requirement for AI systems.
This control is broader than ISM-2158.
Annex A 8.28 covers applying secure coding principles to software development as a whole. ISM-2158 is one specific case within that scope, applied to agentic AI applications, requiring external content to be kept untrusted throughout processing, clearly delimited from system instructions, validated and sanitised, and blocked from overriding security policies, access controls, tool permissions or human approval requirements.
This control partially meets ISM-0401.
ISM-0401 demands Secure by Design practices across the entire SDLC, covering stages like design, build, test, and release. ISO/IEC 27001:2022 Annex A 8.28 targets the specific application of secure coding principles during implementation. Thus, Annex A 8.28 is one part of Secure by Design, while ISM-0401 covers architecture, requirements, and more.
This control partially meets ISM-1780.
Annex A 8.28 requires that secure coding principles are applied during software development. ISM-1780 requires the use of SecDevOps practices for software development, which typically embed secure coding alongside automation, CI/CD controls, security testing and deployment governance. Annex A 8.28 is one component within the broader SecDevOps approach mandated by ISM-1780.
This control partially meets ISM-2061.
ISM-2061 requires developer-supported, security-focused peer reviews to be conducted on all critical and security-relevant software components. Annex A 8.28 requires secure coding principles to be applied during software development, and peer review is a common mechanism to enforce and verify those principles in practice. However, Annex A 8.28 is broader (covering secure coding generally), while ISM-2061 is a specific assurance activity (peer review) within that broader secure coding objective.
This control partially overlaps ISM-0971.
Annex A 8.28 covers applying secure coding principles to software development. ISM-0971 covers using the OWASP Application Security Verification Standard in the development of web applications. Both bear on how software is built securely, and each demands something the other does not: Annex A 8.28 coding principles across all development, ISM-0971 one named standard and its verification requirements for web applications.
This control partially overlaps ISM-1460.
ISM-1460 requires the isolation mechanism vendor to demonstrate Secure by Design/Secure by Default practices, explicitly calling out secure programming and memory-safe languages or practices. Annex A 8.28 mandates that secure coding principles are applied to software development, which aligns with the secure programming expectations embedded in ISM-1460's vendor selection requirement. Annex A 8.28 is generally about how software is coded (typically within the organisation or its development arrangements), while ISM-1460 is specifically about procurement/selection assurance for virtual server isolation products.
- ISM-1826Use Secure by Design and Secure by Default vendors for server applicationsPartially overlaps
This control partially overlaps ISM-1826.
ISM-1826 requires server applications to come from vendors that have demonstrated Secure by Design and Secure by Default practices, including secure programming and memory-safe languages or practices. Annex A 8.28 requires secure coding principles to be applied to software development. Secure coding is the shared ground, but vendor selection and the organisation's own development are separate demands.
This control partially overlaps ISM-2042.
Annex A 8.28 covers applying secure coding principles to software development. ISM-2042 covers following Secure by Default principles and practices throughout the software development life cycle, which extends to making sure all built-in security measures are present and enabled in the base product at no extra cost to consumers. Both bear on secure development, and each demands something the other does not.
This control supports ISM-0402.
Annex A 8.28 requires secure coding principles to be applied to prevent vulnerabilities during software development. ISM-0402 supports this by mandating comprehensive vulnerability testing (SAST/DAST/SCA) prior to releases and periodically, which helps detect when secure coding practices were missed or incorrectly implemented. ISM-0402 is testing-focused and does not itself require secure coding practices to be followed in day-to-day development.
This control supports ISM-2062.
ISM-2062 requires unit and integration testing (positive and negative cases) to validate code quality and security. This supports ISO/IEC 27001:2022 Annex A 8.28 by providing a verification mechanism to demonstrate that secure coding principles are correctly implemented and that security-relevant behaviour holds under expected and misuse conditions. Annex A 8.28 focuses on the coding practices themselves, while ISM-2062 focuses on the testing evidence that those practices are effective.
This control depends on ISM-1924.
ISM-1924 requires organisations to build AI applications that can identify and mitigate adversarial prompt content (e.g. injection strings, malicious suffixes) at the point of use. Annex A 8.28 is a prerequisite because secure coding practices are typically needed to implement robust input validation, policy enforcement, guardrails, and safe prompt-handling patterns without introducing bypasses. Annex A 8.28 is broader across all software development, while ISM-1924 is a specialised secure-by-design requirement for generative AI prompt interfaces.
This control depends on ISM-2037.
Annex A 8.28 requires secure coding principles to be applied in software development. ISM-2037 requires developers who lack sufficient cyber security knowledge to undertake training on secure software development and programming practices, which is a prerequisite to consistently implementing secure coding in practice. Without the capability uplift in ISM-2037, effective fulfilment of Annex A 8.28 is less achievable and harder to sustain.
Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.
Get help with this control
ISO 27001 training
Mindset Cyber, a PECB Authorised Titanium Partner, sells official PECB ISO/IEC 27001 courses that map directly to the controls in this library.




