Skip to content

Commit abdf2a8

Browse files
committed
docs: update OWASP TOP 10 items
1 parent 3503b4d commit abdf2a8

File tree

1 file changed

+110
-98
lines changed

1 file changed

+110
-98
lines changed

user_guide_src/source/concepts/security.rst

Lines changed: 110 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -19,101 +19,126 @@ the CodeIgniter provisions to address the problem.
1919
:local:
2020
:depth: 1
2121

22-
************
23-
A1 Injection
24-
************
22+
******************************
23+
A01:2021 Broken Access Control
24+
******************************
2525

26-
An injection is the inappropriate insertion of partial or complete data via
27-
the input data from the client to the application. Attack vectors include SQL,
28-
XML, ORM, code & buffer overflows.
26+
Insecure Direct Object References occur when an application provides direct
27+
access to objects based on user-supplied input. As a result of this vulnerability
28+
attackers can bypass authorization and access resources in the system directly,
29+
for example database records or files.
30+
31+
Sensitive data must be protected when it is transmitted through the network.
32+
Such data can include user credentials and credit cards. As a rule of thumb,
33+
if data must be protected when it is stored, it must be protected also during
34+
transmission.
35+
36+
CSRF is an attack that forces an end user to execute unwanted actions on a web
37+
application in which he/she is currently authenticated.
2938

3039
OWASP recommendations
3140
=====================
3241

33-
- Presentation: set correct content type, character set & locale
34-
- Submission: validate fields and provide feedback
35-
- Controller: sanitize input; positive input validation using correct character set
36-
- Model: parameterized queries
42+
- Presentation: don't expose internal data; use random reference maps
43+
- Controller: obtain data from trusted sources or random reference maps
44+
- Model: validate user roles before updating data
45+
46+
- Presentation: ensure that non-web data is outside the web root; validate users and roles; send CSRF tokens
47+
- Controller: validate users and roles; validate CSRF tokens
48+
- Model: validate roles
49+
50+
- Presentation: validate users and roles; send CSRF tokens
51+
- Controller: validate users and roles; validate CSRF tokens
52+
- Model: validate roles
3753

3854
CodeIgniter provisions
3955
======================
4056

41-
- :ref:`urls-uri-security`
42-
- :ref:`invalidchars` filter
4357
- :doc:`../libraries/validation` library
44-
- :doc:`HTTP library <../incoming/incomingrequest>` provides for :ref:`input field filtering <incomingrequest-filtering-input-data>` & content metadata
58+
- An official authentication and authorization framework :ref:`CodeIgniter Shield <shield>`
59+
- Easy to add third party authentication
4560

46-
*********************************************
47-
A2 Weak authentication and session management
48-
*********************************************
61+
- :ref:`Public <application-structure-public>` folder, with application and system outside
62+
- :doc:`Security </libraries/security>` library provides for :ref:`CSRF validation <cross-site-request-forgery>`
4963

50-
Inadequate authentication or improper session management can lead to a user
51-
getting more privileges than they are entitled to.
64+
*******************************
65+
A02:2021 Cryptographic Failures
66+
*******************************
67+
68+
Sensitive data must be protected when it is transmitted through the network.
69+
Such data can include user credentials and credit cards. As a rule of thumb,
70+
if data must be protected when it is stored, it must be protected also during
71+
transmission.
5272

5373
OWASP recommendations
5474
=====================
5575

56-
- Presentation: validate authentication & role; send CSRF token with forms
57-
- Design: only use built-in session management
58-
- Controller: validate user, role, CSRF token
59-
- Model: validate role
60-
- Tip: consider the use of a request governor
76+
- Presentation: use TLS1.2; use strong ciphers and hashes; do not send keys or hashes to browser
77+
- Controller: use strong ciphers and hashes
78+
- Model: mandate strong encrypted communications with servers
6179

6280
CodeIgniter provisions
6381
======================
6482

65-
- :doc:`Session <../libraries/sessions>` library
66-
- :doc:`Security </libraries/security>` library provides for CSRF validation
67-
- An official authentication and authorization framework :ref:`CodeIgniter Shield <shield>`
68-
- Easy to add third party authentication
83+
- The config for global secure access (``Config\App::$forceGlobalSecureRequests``)
84+
- :php:func:`force_https()` function
85+
- :doc:`../libraries/encryption`
86+
- The :ref:`database config <database-config-explanation-of-values>` (``encrypt``)
87+
88+
******************
89+
A03:2021 Injection
90+
******************
6991

70-
*****************************
71-
A3 Cross Site Scripting (XSS)
72-
*****************************
92+
An injection is the inappropriate insertion of partial or complete data via
93+
the input data from the client to the application. Attack vectors include SQL,
94+
XML, ORM, code & buffer overflows.
7395

7496
Insufficient input validation where one user can add content to a web site
7597
that can be malicious when viewed by other users to the web site.
7698

7799
OWASP recommendations
78100
=====================
79101

102+
- Presentation: set correct content type, character set & locale
103+
- Submission: validate fields and provide feedback
104+
- Controller: sanitize input; positive input validation using correct character set
105+
- Model: parameterized queries
106+
80107
- Presentation: output encode all user data as per output context; set input constraints
81108
- Controller: positive input validation
82109
- Tips: only process trustworthy data; do not store data HTML encoded in DB
83110

84111
CodeIgniter provisions
85112
======================
86113

114+
- :ref:`urls-uri-security`
115+
- :ref:`invalidchars` filter
116+
- :doc:`../libraries/validation` library
117+
- :doc:`HTTP library <../incoming/incomingrequest>` provides for :ref:`input field filtering <incomingrequest-filtering-input-data>` & content metadata
118+
87119
- :php:func:`esc()` function
88120
- :doc:`../libraries/validation` library
89121
- Support for :ref:`content-security-policy`
90122

91-
***********************************
92-
A4 Insecure Direct Object Reference
93-
***********************************
123+
************************
124+
A04:2021 Insecure Design
125+
************************
94126

95-
Insecure Direct Object References occur when an application provides direct
96-
access to objects based on user-supplied input. As a result of this vulnerability
97-
attackers can bypass authorization and access resources in the system directly,
98-
for example database records or files.
127+
@TODO
99128

100129
OWASP recommendations
101130
=====================
102131

103-
- Presentation: don't expose internal data; use random reference maps
104-
- Controller: obtain data from trusted sources or random reference maps
105-
- Model: validate user roles before updating data
132+
- @TODO
106133

107134
CodeIgniter provisions
108135
======================
109136

110-
- :doc:`../libraries/validation` library
111-
- An official authentication and authorization framework :ref:`CodeIgniter Shield <shield>`
112-
- Easy to add third party authentication
137+
- @TODO
113138

114-
****************************
115-
A5 Security Misconfiguration
116-
****************************
139+
**********************************
140+
A05:2021 Security Misconfiguration
141+
**********************************
117142

118143
Improper configuration of an application architecture can lead to mistakes
119144
that might compromise the security of the whole architecture.
@@ -130,104 +155,91 @@ CodeIgniter provisions
130155

131156
- Sanity checks during bootstrap
132157

133-
**************************
134-
A6 Sensitive Data Exposure
135-
**************************
158+
*******************************************
159+
A06:2021 Vulnerable and Outdated Components
160+
*******************************************
136161

137-
Sensitive data must be protected when it is transmitted through the network.
138-
Such data can include user credentials and credit cards. As a rule of thumb,
139-
if data must be protected when it is stored, it must be protected also during
140-
transmission.
162+
Many applications have known vulnerabilities and known attack strategies that
163+
can be exploited in order to gain remote control or to exploit data.
141164

142165
OWASP recommendations
143166
=====================
144167

145-
- Presentation: use TLS1.2; use strong ciphers and hashes; do not send keys or hashes to browser
146-
- Controller: use strong ciphers and hashes
147-
- Model: mandate strong encrypted communications with servers
168+
- Don't use any of these
148169

149170
CodeIgniter provisions
150171
======================
151172

152-
- The config for global secure access (``Config\App::$forceGlobalSecureRequests``)
153-
- :php:func:`force_https()` function
154-
- :doc:`../libraries/encryption`
155-
- The :ref:`database config <database-config-explanation-of-values>` (``encrypt``)
173+
- Third party libraries incorporated must be vetted
156174

157-
****************************************
158-
A7 Missing Function Level Access Control
159-
****************************************
175+
***************************************************
176+
A07:2021 Identification and Authentication Failures
177+
***************************************************
160178

161-
Sensitive data must be protected when it is transmitted through the network.
162-
Such data can include user credentials and credit cards. As a rule of thumb,
163-
if data must be protected when it is stored, it must be protected also during
164-
transmission.
179+
Inadequate authentication or improper session management can lead to a user
180+
getting more privileges than they are entitled to.
165181

166182
OWASP recommendations
167183
=====================
168184

169-
- Presentation: ensure that non-web data is outside the web root; validate users and roles; send CSRF tokens
170-
- Controller: validate users and roles; validate CSRF tokens
171-
- Model: validate roles
185+
- Presentation: validate authentication & role; send CSRF token with forms
186+
- Design: only use built-in session management
187+
- Controller: validate user, role, CSRF token
188+
- Model: validate role
189+
- Tip: consider the use of a request governor
172190

173191
CodeIgniter provisions
174192
======================
175193

176-
- :ref:`Public <application-structure-public>` folder, with application and system outside
177-
- :doc:`Security </libraries/security>` library provides for :ref:`CSRF validation <cross-site-request-forgery>`
194+
- :doc:`Session <../libraries/sessions>` library
195+
- :doc:`Security </libraries/security>` library provides for CSRF validation
196+
- An official authentication and authorization framework :ref:`CodeIgniter Shield <shield>`
197+
- Easy to add third party authentication
178198

179-
************************************
180-
A8 Cross Site Request Forgery (CSRF)
181-
************************************
199+
*********************************************
200+
A08:2021 Software and Data Integrity Failures
201+
*********************************************
182202

183-
CSRF is an attack that forces an end user to execute unwanted actions on a web
184-
application in which he/she is currently authenticated.
203+
@TODO
185204

186205
OWASP recommendations
187206
=====================
188207

189-
- Presentation: validate users and roles; send CSRF tokens
190-
- Controller: validate users and roles; validate CSRF tokens
191-
- Model: validate roles
208+
- @TODO
192209

193210
CodeIgniter provisions
194211
======================
195212

196-
- :doc:`Security </libraries/security>` library provides for :ref:`CSRF validation <cross-site-request-forgery>`
213+
- @TODO
197214

198-
**********************************************
199-
A9 Using Components with Known Vulnerabilities
200-
**********************************************
215+
*************************************************
216+
A09:2021 Security Logging and Monitoring Failures
217+
*************************************************
201218

202-
Many applications have known vulnerabilities and known attack strategies that
203-
can be exploited in order to gain remote control or to exploit data.
219+
@TODO
204220

205221
OWASP recommendations
206222
=====================
207223

208-
- Don't use any of these
224+
- @TODO
209225

210226
CodeIgniter provisions
211227
======================
212228

213-
- Third party libraries incorporated must be vetted
229+
- @TODO
214230

215-
**************************************
216-
A10 Unvalidated Redirects and Forwards
217-
**************************************
231+
*******************************************
232+
A10:2021 Server-Side Request Forgery (SSRF)
233+
*******************************************
218234

219-
Faulty business logic or injected actionable code could redirect the user
220-
inappropriately.
235+
@TODO
221236

222237
OWASP recommendations
223238
=====================
224239

225-
- Presentation: don't use URL redirection; use random indirect references
226-
- Controller: don't use URL redirection; use random indirect references
227-
- Model: validate roles
240+
- @TODO
228241

229242
CodeIgniter provisions
230243
======================
231244

232-
- :doc:`HTTP library <../incoming/incomingrequest>` provides for ...
233-
- :doc:`Session <../libraries/sessions>` library provides :ref:`sessions-flashdata`
245+
- @TODO

0 commit comments

Comments
 (0)