+CON.10 Development of Web Applications
---+CON.10.G1. Bypassing Authorisations in Web Applications
---+CON.10.G2. Insufficient Input Validation and Output Encoding
---+CON.10.G3. Insufficient Error Handling by Web Applications
---+CON.10.G4. Insufficient Logging of Security-Relevant Events
---+CON.10.G5. Disclosure of Security-Relevant Information Through Web Applications
---+CON.10.G6. Misuse of a Web Application Due to Automated Use
---+CON.10.G7. Inadequate Session Management in Web Applications
---+CON.10.A1 Authentication for Web Applications (B)
---+CON.10.A2 Access Control for Web Applications (B)
---+CON.10.A3 Secure Session Management (B)
---+CON.10.A4 Controlled Integration of Content in Web Applications (B)
---+CON.10.A5 Upload Functions (B)
---+CON.10.A6 Protection Against Unauthorised Automated Use of Web Applications (B)
---+CON.10.A7 Protection of Confidential Data (B)
---+CON.10.A8 Comprehensive Input Validation and Output Encoding (B)
---+CON.10.A9 Protection Against SQL Injections (B)
---+CON.10.A10 Restrictive Disclosure of Security-Related Information (B)
---+CON.10.A11 Software Architecture of a Web Application (S)
---+CON.10.A12 Verification of Essential Changes (S)
---+CON.10.A13 Error Handling (S)
---+CON.10.A14 Secure HTTP Configuration of Web Applications (S)
---+CON.10.A15 Prevention of Cross-Site Request Forgery (S)
---+CON.10.A16 Multi-Factor Authentication (S)
---+CON.10.A17 Preventing Resources from Being Blocked (H)
---+CON.10.A18 Cryptographic Protection of Confidential Data (H)

CON.10 Development of Web Applications

Introduction

Web applications provide users with particular functions and dynamic (changing) content. For this purpose, web applications make documents and user interfaces available on a server (e.g. in the form of input masks) and deliver them on request to corresponding programs on clients such as web browsers. Web applications are usually developed on the basis of frameworks. Frameworks are reusable program templates for frequently recurring tasks. Frameworks are also available for security components.

Web applications must implement security mechanisms that ensure the protection of the information they process and prevent it from being misused. Some typical security components or mechanisms include authentication, authorisation, input validation, output encoding, session management, error handling, and logging.

Developers must be familiar with the relevant security mechanisms of their web applications. For this reason, the development process has a crucial influence on the security of software.

Objective

The aim of this module is to ensure the secure development of web applications and protect the information they process.

Scoping and Modelling

This module must be applied to any development project involving web applications in a given information domain.

It considers the specific hazards and requirements relevant to the development of web applications. Requirements for the secure use of web applications are not considered here. These can be found in module APP.3.1 Web Applications. General requirements for secure software development are also not covered here. These are addressed in module CON.8 Software Development.

Useful Resources

On its website, the Open Web Application Security Project provides guidance on securing web applications.

The Federal Office for Information Security (BSI) provides guidance on the use of cryptographic procedures in the document “Cryptographic Mechanisms: Recommendations and Key Lengths: BSI TR-02102”.

The Federal Office for Information Security (BSI) provides guidance on developing secure web applications in the document “Entwicklung sicherer Webanwendungen” [Development of Secure Web Applications].

The Federal Office for Information Security (BSI) provides companies with guidance on developing secure web applications in “Leitfaden zur Entwicklung sicherer Webanwendungen” [BSI Guide for the Development of Secure Web Applications].

1. Oversigt

Titel Standard
CON.10.A1 Authentication for Web Applications (B)

Developers MUST ensure that users securely and appropriately authenticate themselves to a web application before they can access protected functions or content. An appropriate authentication method MUST be selected. The selection process MUST be documented.

A central authentication component MUST be used. The central authentication component SHOULD be used with established standard components (e.g. from frameworks or program libraries). If a web application stores authentication data on a client, the user MUST be explicitly informed about the risks of this function and consent to it (“opt-in”).

The web application MUST offer the option to set limits for failed login attempts. The web application MUST inform users immediately if their password has been reset.

CON.10.A2 Access Control for Web Applications (B)

An authorisation component MUST be used by Developers to ensure that users can only perform actions for which they are authorised. Every attempt to access protected content and functions MUST be checked before being allowed.

The authorisation component MUST consider all the resources and content administered by a web application. If the corresponding access control system is defective, access MUST be denied. Access control MUST also be in place for URL calls and object references.

CON.10.A3 Secure Session Management (B)

Developers MUST ensure that session IDs are protected appropriately. Session IDs MUST be generated randomly and with sufficient entropy. If the web application framework in use can generate secure session IDs, the Developers MUST use this feature. The security-relevant configuration options of the framework MUST be considered. If session IDs are transmitted and stored by the clients, they MUST be transmitted with sufficient protection.

A web application MUST provide users with the option to expressly terminate an active session. After a user has logged in, any existing session ID MUST be replaced by a new one. Sessions MUST have a maximum validity period (timeout). Inactive sessions MUST automatically expire after a specified period of time. After a session has become invalid, all the session data MUST be rendered invalid and deleted.

CON.10.A4 Controlled Integration of Content in Web Applications (B)

Developers MUST ensure that a web application only integrates the intended content for delivery to the user.

The destinations of the redirection function of a web application MUST be restricted sufficiently so that users are only redirected to trustworthy websites. If a user is leaving a trustworthy domain, the web application MUST inform them of this.

CON.10.A5 Upload Functions (B)

Developers MUST ensure that a user can only save files under the specified path. Developers MUST ensure that a user cannot influence the storage location for uploads. Developers MUST integrate functions into their web applications that allow operators of the applications to configure uploads.

CON.10.A6 Protection Against Unauthorised Automated Use of Web Applications (B)

Developers MUST implement security mechanisms that protect their web applications from automated access. When implementing the security mechanisms, Developers MUST consider how they affect the options available to authorised users.

CON.10.A7 Protection of Confidential Data (B)

Developers MUST ensure that confidential data is transferred from clients to servers using only the HTTP post method.

Developers MUST use directives in web applications to ensure that no sensitive data is cached on the client side. Developers MUST ensure that no confidential form data is displayed in plain text in forms. A web application SHOULD prevent confidential data from being stored unexpectedly by the web browser. All web application access data MUST be protected against unauthorised access on the server side with the help of cryptographic algorithms (salted hash). The files containing the source code of a web application MUST be protected against unauthorised retrieval.

CON.10.A8 Comprehensive Input Validation and Output Encoding (B)

Developers MUST treat all data passed to a web application as potentially dangerous and filter it appropriately. All input data, as well as data streams and secondary data (such as session IDs), MUST be validated on the server side.

The automatic handling of erroneous input SHOULD be minimised (through sanitising) to the greatest extent possible. If it is unavoidable, sanitising MUST be implemented securely.

Output data MUST be encoded so that malicious code is not interpreted or executed on the target system.

CON.10.A9 Protection Against SQL Injections (B)

If data is passed to a database management system (DBMS), Developers MUST use stored procedures or prepared SQL statements. If data is passed to a DBMS and neither stored procedures nor prepared SQL statements are supported by the operational environment, SQL queries MUST be secured separately.

CON.10.A10 Restrictive Disclosure of Security-Related Information (B)

Developers MUST ensure that webpages, responses, and error messages from web applications do not contain information that would provide an attacker with insights into how to bypass corresponding security mechanisms.

CON.10.A11 Software Architecture of a Web Application (S)

Developers SHOULD document the software architecture of their web applications along with all their components and dependencies. The documentation SHOULD be updated and adapted during the development process. The documentation SHOULD be designed so that it can be used in the development phase and the decisions taken will be comprehensible. The documentation SHOULD identify all the components necessary for operation that are not part of the respective web application. The documentation SHOULD also describe which components implement which security mechanisms, how the web application is to be integrated into an existing infrastructure, and which cryptographic functions and procedures are used.

CON.10.A12 Verification of Essential Changes (S)

If important settings are to be changed with an application, the Developers SHOULD ensure that the changes are verified again by entering a password. If this is not possible, the web application SHOULD ensure that users authenticate themselves by other appropriate means. Users SHOULD be informed of changes via communication channels outside the web application.

CON.10.A13 Error Handling (S)

If errors occur during the runtime of a web application, the Developers SHOULD ensure that the application handles them in a way that enables it to remain in a consistent state.

The web application SHOULD log error messages. If an initiated action causes an error, the web application SHOULD cancel that action. If an error occurs, the web application SHOULD deny access to the resource or function being requested.

Previously reserved resources SHOULD be released within the framework of error handling. Errors SHOULD be handled by the web application itself whenever possible.

CON.10.A14 Secure HTTP Configuration of Web Applications (S)

To protect against clickjacking, cross-site scripting, and other attacks, Developers SHOULD set appropriate HTTP response headers. The following HTTP headers SHOULD be used at minimum: Content-Security-Policy, Strict-Transport-Security, Content-Type, X-Content-Type-Options, and Cache-Control. The HTTP headers used SHOULD be adapted to the web application at hand. The HTTP headers used SHOULD be as restrictive as possible.

Cookies SHOULD always be set with the attributes secure, SameSite, and httponly.

CON.10.A15 Prevention of Cross-Site Request Forgery (S)

Developers SHOULD equip web applications with the security mechanisms required to distinguish between users' intended page requests and unintentionally forwarded third-party commands. At minimum, whether a secret token is required in addition to the session ID for access to protected resources and functions SHOULD be checked.

CON.10.A16 Multi-Factor Authentication (S)

Developers SHOULD implement multi-factor authentication.

CON.10.A17 Preventing Resources from Being Blocked (H)

As protection against denial-of-service (DoS) attacks, resource-intensive operations SHOULD be avoided. Where resource-intensive operations are necessary, a particular effort SHOULD be made to secure them. For web applications, potential overflows of log data SHOULD be monitored and prevented.

CON.10.A18 Cryptographic Protection of Confidential Data (H)

Developers SHOULD ensure that a web application's confidential data is protected by secure cryptographic algorithms.

1.1 Referencer

1.2 Identificerede krav

1.3 Relaterede reguleringer

2. Identificerede krav

Krav
Kilde Krav

3. Relaterede reguleringer

Reguleringer
Kilde Regulering

Linkede sager