51e31d59db81ea2fb690cb74efc17ce7d1ad7e88
[ssproject1617.git] / report / v5_input.tex
1 \begin{enumerate}[label={5.\arabic*}]
2 \item\pass{} Verify that the runtime environment is not susceptible to buffer
3 overflows, or that security controls prevent buffer overflows.
4
5 As of \emph{OWASP}'s statement\footnote{\url{%
6 https://www.owasp.org/index.php/Buffer_Overflows\#Platforms_Affected}}
7 \PHP{} is not surceptible to buffer overflows as long no external
8 programs or extensions are used which is not the case.
9 % They skip 5.2
10 \addtocounter{enumi}{1}
11 \item\fail{} Verify that server side input validation failures result in
12 request rejection and are logged.
13
14 \texttt{filter\_var} is used for input validation and while errors are
15 returned to the user, no logging taking place.
16 % They skip 5.4
17 \addtocounter{enumi}{1}
18 \item\pass{} Verify that input validation routines are enforced on the
19 server side.
20
21 Errors are accumulated in an array which, when non-empty, will fail the
22 function and report the error.
23 \notapplicable{\item Verify that a single input validation control is used
24 by the application for each type of data that is accepted.}
25
26 % They skip 5.7-5.9
27 \addtocounter{enumi}{3}
28 \item\fail{} Verify that all \SQL{} queries, \texttt{HQL}, \texttt{OSQL},
29 \texttt{NOSQL} and stored procedures, calling of stored procedures are
30 protected by the use of prepared statements or query parameterization,
31 and thus not susceptible to \SQL{} injection.
32
33 This is not the case. For example in \srcref{classes/users.php}{45}.
34 However, in some cases prepared statements are used, such as is
35 \srcref{classes/users.php}{145}.
36 \item\pass{} Verify that the application is not susceptible to LDAP
37 Injection, or that security controls prevent LDAP Injection.
38
39 \LDAP{} is not used, thus the application is not susceptible.
40 \item\pass{} Verify that the application is not susceptible to OS Command
41 Injection, or that security controls prevent OS Command Injection.
42
43 This requirement heavily depends on the configuration of the \PHP{}
44 interpreter and database, there are no system commands used but since
45 it is trivial to do an \SQL{} injection it might be possible to run
46 commands via the database. However, which a sufficiently secure \SQL{}
47 config this can not take place.
48
49 %TODO hier nog even naar kijken
50 \item\pass{} Verify that the application is not susceptible to Remote File
51 Inclusion (RFI) or Local File Inclusion (LFI) when content is used that
52 is a path to a file.
53
54 Some file inclusion might be possible in the themes. Also in password
55 recovery\\
56 (\srcref{classes/user.php}{115}) filepaths are calculated on the
57 hash of the password. All non standard filepaths, such as admin or
58 theme files, are generated using functions. CMS urls are parsed using a
59 standard system wide \texttt{parse} function.
60 \item\pass{} Verify that the application is not susceptible to common
61 \XML{} attacks, such as XPath query tampering, \XML{} External Entity
62 attacks, and \XML{} injection attacks.
63
64 No \XML{} or related techniques are used and thus the application is
65 not susceptible.
66 \item\fail{} Ensure that all string variables placed into \HTML{} or other
67 web client code is either properly contextually encoded manually, or
68 utilize templates that automatically encode contextually to ensure the
69 application is not susceptible to reflected, stored and DOM Cross-Site
70 Scripting (XSS) attacks.
71
72 A lot of \HTML{} tags are allowed in the post screen, therefore an XSS
73 attack is trivial. Even the comment section uses no input validation
74 whatsoever.
75 \item\pass{} If the application framework allows automatic mass parameter
76 assignment (also called automatic variable binding) from the inbound
77 request to a model, verify that security sensitive fields such as
78 ``accountBalance'', ``role'' or ``password'' are protected from
79 malicious automatic binding.
80
81 There is some automatic variable binding happening in the POST and GET
82 however, defaults are always given and there is no possibility of
83 accidentally binding extra variables. Also the variables are in an
84 array.
85 \item\pass{} Verify that the application has defenses against HTTP
86 parameter pollution attacks, particularly if the application framework
87 makes no distinction about the source of request parameters (GET, POST,
88 cookies, headers, environment, etc.)
89
90 The system explicitly makes a difference with the different input
91 types. As said in the previous item, the function that does this
92 parameter parsing is system wide and uses defaults and filters unwanted
93 parameters.
94 \item\fail{} Verify that client side validation is used as a second line of
95 defense, in addition to server side validation.
96
97 There is client side validation on comments in the email section. There
98 is no validation for the comments itself to check for malafide \HTML{}.
99 In the admin panel the email address is not validated.
100 \item\fail{} Verify that all input data is validated, not only \HTML{} form
101 fields but all sources of input such as REST calls, query parameters,
102 HTTP headers, cookies, batch files, RSS feeds, etc; using positive
103 validation (whitelisting), then lesser forms of validation such as
104 greylisting (eliminating known bad strings), or rejecting bad inputs
105 (blacklisting).
106
107 REST calls are validated using whitelisting, query parameters are not,
108 headers are not, cookies not, batch files are non-existent and RSS feed
109 output is not filtered.
110 \item\pass{} Verify that structured data is strongly typed and validated
111 against a defined schema including allowed characters, length and
112 pattern (e.g.\ credit card numbers or telephone, or validating that two
113 related fields are reasonable, such as validating suburbs and zip or
114 post codes match).
115
116 Email addresses are validated against \PHP's stander functionality.
117 Note that the \PHP{} email validation is not perfect and some valid
118 email addresses are rejected (such as email addresses with non-ASCII
119 characters). The other requirements are not used.
120 \item\pass{} Verify that unstructured data is sanitized to enforce generic
121 safety measures such as allowed characters and length, and characters
122 potentially harmful in given context should be escaped (e.g.\ natural
123 names with Unicode or apostrophes, such as
124 \begin{CJK}{UTF8}{min}ねこ\end{CJK} or O'Hara)
125
126 Emailaddresses with non-ASCII characters are rejected. Unicode
127 characters are displayed correctly.
128 \item\fail{} Make sure untrusted \HTML{} from WYSIWYG editors or similar are
129 properly sanitized with an \HTML{} sanitizer and handle it
130 appropriately according to the input validation task and encoding task.
131
132 This is not the case, any \HTML{} is allowed.
133 \item\fail{} For auto-escaping template technology, if UI escaping is disabled,
134 ensure that \HTML{} sanitization is enabled instead.
135
136 See previous item.
137 \item\pass{} Verify that data transferred from one DOM context to another,
138 uses safe JavaScript methods, such as using \texttt{.innerText} and
139 \texttt{.val}.
140
141 The \JQuery{} framework is used for this.
142 \item\pass{} Verify when parsing \JSON{} in browsers, that
143 \texttt{JSON.parse} is used to parse \JSON{} on the client. Do not use
144 \texttt{eval()} to parse \JSON{} on the client.
145
146 There is no \JSON{} transfer outside the toolkits.
147 \item\pass{} Verify that authenticated data is cleared from client storage,
148 such as the browser DOM, after the session is terminated.
149
150 No DOM storage is used.
151 \end{enumerate}