Open in TheBrain

ISO IEC 27002 2022 — 8.28 Secure coding


source: false

type: canonical-control-reference

standard: "ISO/IEC 27002"

document_version: "2022"

element_id: "8.28"

family_id: "8"

family: "Technological Controls"

title: "Secure coding"

status: active

assessment_criterion: true

reference_basis: "user-supplied licensed ISO canonical publication"

normative_text_included: true

source_location: "PDF pages 132–134; printed pages 122–124"

updated: 2026-09-11

scf_mappings: ["TDA-06"]

authoritative_sources:

- "ISO/IEC 27002:2022 canonical PDF"

text_kind: guidance

source_text_verified: true


8.28 Secure coding

Control Attributes

Attribute Value


Control type #Preventive
Information security properties #Confidentiality #Integrity #Availability
Cybersecurity concepts #Protect
Operational capabilities #Application_security #System_and_network_security
Security domains #Protection

Control

Secure coding principles should be applied to software development.

Purpose

To ensure software is written securely thereby reducing the number of potential information security vulnerabilities in the software.

Guidance

General

The organization should establish organization-wide processes to provide good governance for secure coding. A minimum secure baseline should be established and applied. Additionally, such processes and governance should be extended to cover software components from third parties and open source software.

The organization should monitor real world threats and up-to-date advice and information on software vulnerabilities to guide the organization’s secure coding principles through continual improvement and learning. This can help with ensuring effective secure coding practices are implemented to combat the fast-changing threat landscape.

Planning and before coding

Secure coding principles should be used both for new developments and in reuse scenarios. These principles should be applied to development activities both within the organization and for products and services supplied by the organization to others. Planning and prerequisites before coding should include:

During coding

Considerations during coding should include:

Testing should be conducted during and after development (see 8.29). Static application security testing (SAST) processes can identify security vulnerabilities in software.

Before software is made operational, the following should be evaluated:

Review and maintenance

After code has been made operational:

If using external tools and libraries, the organization should consider:

Where a software package needs to be modified the following points should be considered:

Other Information

A guiding principle is to ensure security-relevant code is invoked when necessary and is tamper-resistant. Programs installed from compiled binary code also have these properties but only for data held within the application. For interpreted languages, the concept only works when the code is executed on a server that is otherwise inaccessible by the users and processes that use it, and that its data is held in a similarly protected database. For example, the interpreted code can be run on a cloud service where access to the code itself requires administrator privileges. Such administrator access should be protected by security mechanisms such as just-in-time administration principles and strong authentication. If the application owner can access scripts by direct remote access to the server, so in principle can an attacker. Webservers should be configured to prevent directory browsing in such cases.

Application code is best designed on the assumption that it is always subject to attack, through error or malicious action. In addition, critical applications can be designed to be tolerant of internal faults. For example, the output from a complex algorithm can be checked to ensure that it lies within safe bounds before the data is used in an application such as a safety or financial critical application. The code that performs the boundary checks is simple and therefore much easier to prove correctness.

Some web applications are susceptible to a variety of vulnerabilities that are introduced by poor design and coding, such as database injection and cross-site scripting attacks. In these attacks, requests can be manipulated to abuse the webserver functionality.

More information on ICT security evaluation can be found in the ISO/IEC 15408 series.

SCF Relationships

Mappings below are from the SCF STRM for ISO/IEC 27002; the source element and relationship are retained.

Source element SCF control Relationship Strength Mapping PDF page





8.28 TDA-06 (unresolved reference: References/Secure Controls Framework 2026.2/TDA Technology Development & Acquisition/TDA-06 Secure Software Development Practices (SSDP).md) Equal 10 14

Notes

References