Skip to content
Software development
ASD ISMISM-2041

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.

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

  1. 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.

  2. 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).

  3. 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.

  4. 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

  1. 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.

  2. 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.

  3. 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 27001

ISO/IEC 27001: 2 mappings

  • A.8.25Secure development life cyclePartially meets
  • A.8.28Secure codingPartially meets

Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.