ASD ISM 2041 Prefer memory-safe programming languages, otherwise memory-safe practices
What it says
Memory-safe programming languages, or less preferably memory-safe programming practices, are used for software development.
Quoted as published. Everything else on this page is written by Control Stack.
In plain English
Develop software in a memory-safe programming language such as Rust, Go or Java; the less preferred alternative is memory-safe programming practices in languages like C and C++.
Software development must use memory-safe programming languages or, less preferably, memory-safe programming practices. A memory-safe language, such as Rust, Go, Java or C#, is designed to prevent memory errors, like writing past the end of a buffer or using memory after it has been freed. C, C++ and assembly are not memory-safe, so code in them needs memory-safe practices: coding rules, safer libraries and testing that prevent or find those errors. Both routes meet the control, but the language route is preferred.
Free. Save your status, tasks and notes.
Why it matters
Memory errors such as buffer overflows are a major source of serious vulnerabilities, often letting attackers crash software or run their own code. Memory-safe languages rule out most of them by design, and memory-safe practices reduce and catch them elsewhere.
How to implement
Record the language of every component.
Scan the authoritative source for software (ISM-2023), including native libraries that memory-safe code calls, and mark each component as memory-safe or not.
Choose a memory-safe language for new software and components.
Where a language such as C or C++ is chosen instead, for example for a driver or to extend an existing codebase, record the reason as a security design decision (ISM-2034).
Apply memory-safe practices to every non-memory-safe component the organisation writes or maintains.
Use bounds-checked containers and smart pointers instead of raw buffers and pointers, ban unsafe functions such as strcpy, turn on compiler hardening options (ISM-2031), and test with memory error detectors and fuzzing, which feeds malformed input to find crashes.
Contain unsafe code inside memory-safe languages.
Keep unsafe blocks and calls into native code in small, clearly marked modules, and flag every change to them for code review (ISM-2060), because they bypass the language's protection.
Keep it running
Re-run the language scan when components or native libraries are added. When a C or C++ component is due for a major rewrite, reconsider a memory-safe language, because a rewrite is the cheapest point to switch.
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 record of memory-safe and non-memory-safe components.
Look at
Whether every component in a non-memory-safe language is on the record and, where the organisation writes or maintains it, has memory-safe practices applied.
Good evidence
Every component the scan finds in a language such as C, C++ or assembly is on the record, and each one the organisation writes or maintains has memory-safe practices in place.
- Check 2 of 3What an auditor asks for
Ask for
The build configuration, static analysis output and test results for a sampled non-memory-safe component that the organisation writes or maintains.
Look at
Whether compiler hardening options, checks for unsafe functions, and memory error detection or fuzzing actually run.
Good evidence
The component builds with hardening options on, static analysis flags unsafe memory functions on every change, and memory error detection or fuzzing runs in testing, with findings fixed before release.
- Check 3 of 3What an auditor asks for
Ask for
A search of a sampled memory-safe codebase for unsafe blocks and calls into native code.
Look at
How much code bypasses the language's memory safety and whether each instance was reviewed.
Good evidence
Code that bypasses memory safety is confined to identified modules, and each instance found has a code review record.
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-2041 requires memory-safe languages or memory-safe programming practices as a concrete security requirement for software development. Annex A 8.25 requires establishing and applying rules for a secure development lifecycle across the full SDLC, which would typically incorporate secure coding standards such as memory safety. ISM-2041 is a specific technical rule within the broader governance and process scope of Annex A 8.25.
This control partially meets A.8.28.
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.
Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.




