<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/index.php?action=history&amp;feed=atom&amp;title=OWASP_Secure_Coding_Practices_Checklist</id>
		<title>OWASP Secure Coding Practices Checklist - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/index.php?action=history&amp;feed=atom&amp;title=OWASP_Secure_Coding_Practices_Checklist"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Secure_Coding_Practices_Checklist&amp;action=history"/>
		<updated>2026-04-10T15:19:51Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Secure_Coding_Practices_Checklist&amp;diff=206975&amp;oldid=prev</id>
		<title>Dariodf: Created page with &quot;''This is a copy of the SCP checklist. For the project, see OWASP Secure Coding Practices - Quick Reference Guide.''...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Secure_Coding_Practices_Checklist&amp;diff=206975&amp;oldid=prev"/>
				<updated>2016-01-21T13:30:33Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;This is a copy of the SCP checklist. For the project, see &lt;a href=&quot;/index.php/OWASP_Secure_Coding_Practices_-_Quick_Reference_Guide&quot; title=&quot;OWASP Secure Coding Practices - Quick Reference Guide&quot;&gt;OWASP Secure Coding Practices - Quick Reference Guide&lt;/a&gt;.&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;''This is a copy of the SCP checklist. For the project, see [[OWASP_Secure_Coding_Practices_-_Quick_Reference_Guide|OWASP Secure Coding Practices - Quick Reference Guide]].''&lt;br /&gt;
== Input Validation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;1&amp;quot;&amp;gt;1.&amp;lt;/span&amp;gt;  Conduct all data validation on a trusted system (e.g., The server)   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;2&amp;quot;&amp;gt;2.&amp;lt;/span&amp;gt;  Identify all data sources and classify them into trusted and untrusted. Validate all data from untrusted sources (e.g., Databases, file streams, etc.)  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;3&amp;quot;&amp;gt;3.&amp;lt;/span&amp;gt;  There should be a centralized input validation routine for the application &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;4&amp;quot;&amp;gt;4.&amp;lt;/span&amp;gt;  Specify proper character sets, such as UTF-8, for all sources of input &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;5&amp;quot;&amp;gt;5.&amp;lt;/span&amp;gt;  Encode data to a common character set before validating (Canonicalize) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;6&amp;quot;&amp;gt;6.&amp;lt;/span&amp;gt;  All validation failures should result in input rejection &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;7&amp;quot;&amp;gt;7.&amp;lt;/span&amp;gt;  Determine if the system supports UTF-8 extended character sets and if so, validate after UTF-8 decoding is completed &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;8&amp;quot;&amp;gt;8.&amp;lt;/span&amp;gt;  Validate all client provided data before processing, including all parameters, URLs and HTTP header content (e.g. Cookie names and values). Be sure to include automated post backs from JavaScript, Flash or other embedded code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;9&amp;quot;&amp;gt;9.&amp;lt;/span&amp;gt;  Verify that header values in both requests and responses contain only ASCII characters &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;10&amp;quot;&amp;gt;10.&amp;lt;/span&amp;gt; Validate data from redirects (An attacker may submit malicious content directly to the target of the redirect, thus circumventing application logic and any validation performed before the redirect)   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;11&amp;quot;&amp;gt;11.&amp;lt;/span&amp;gt; Validate for expected data types  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;12&amp;quot;&amp;gt;12.&amp;lt;/span&amp;gt; Validate data range &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;13&amp;quot;&amp;gt;13.&amp;lt;/span&amp;gt; Validate data length &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;14&amp;quot;&amp;gt;14.&amp;lt;/span&amp;gt; Validate all input against a &amp;quot;white&amp;quot; list of allowed characters, whenever possible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;15&amp;quot;&amp;gt;15.&amp;lt;/span&amp;gt; If any potentially hazardous characters must be allowed as input, be sure that you implement additional controls like output encoding, secure task specific APIs and accounting for the utilization of that data throughout the application. Examples of common hazardous characters include:  &amp;lt; &amp;gt; &amp;quot; ' % ( ) &amp;amp; + \ \' \&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;16&amp;quot;&amp;gt;16.&amp;lt;/span&amp;gt; If your standard validation routine cannot address the following inputs, then they should be checked discretely &lt;br /&gt;
&lt;br /&gt;
* Check for null bytes (%00) &lt;br /&gt;
&lt;br /&gt;
* Check for new line characters (%0d, %0a, \r, \n) &lt;br /&gt;
&lt;br /&gt;
* Check for “dot-dot-slash&amp;quot; (../ or ..\) path alterations characters. In cases where UTF-8 extended character set encoding is supported, address alternate representation like: %c0%ae%c0%ae/  &lt;br /&gt;
&lt;br /&gt;
(Utilize canonicalization to address double encoding or other forms of obfuscation attacks) &lt;br /&gt;
&lt;br /&gt;
== Output Encoding ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;17&amp;quot;&amp;gt;17.&amp;lt;/span&amp;gt; Conduct all encoding on a trusted system (e.g., The server) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;18&amp;quot;&amp;gt;18.&amp;lt;/span&amp;gt; Utilize a standard, tested routine for each type of outbound encoding &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;19&amp;quot;&amp;gt;19.&amp;lt;/span&amp;gt; Contextually output encode all data returned to the client that originated outside the application's trust boundary. HTML entity encoding is one example, but does not work in all cases &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;20&amp;quot;&amp;gt;20.&amp;lt;/span&amp;gt; Encode all characters unless they are known to be safe for the intended interpreter &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;21&amp;quot;&amp;gt;21.&amp;lt;/span&amp;gt; Contextually sanitize all output of un-trusted data to queries for SQL, XML, and LDAP &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;22&amp;quot;&amp;gt;22.&amp;lt;/span&amp;gt; Sanitize all output of un-trusted data to operating system commands &lt;br /&gt;
&lt;br /&gt;
== Authentication and Password Management ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;23&amp;quot;&amp;gt;23.&amp;lt;/span&amp;gt; Require authentication for all pages and resources, except those specifically intended to be public &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;24&amp;quot;&amp;gt;24.&amp;lt;/span&amp;gt; All authentication controls must be enforced on a trusted system (e.g., The server)   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;25&amp;quot;&amp;gt;25.&amp;lt;/span&amp;gt; Establish and utilize standard, tested, authentication services whenever possible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;26&amp;quot;&amp;gt;26.&amp;lt;/span&amp;gt; Use a centralized implementation for all authentication controls, including libraries that call external authentication services  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;27&amp;quot;&amp;gt;27.&amp;lt;/span&amp;gt; Segregate authentication logic from the resource being requested and use redirection to and from the centralized authentication control &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;28&amp;quot;&amp;gt;28.&amp;lt;/span&amp;gt; All authentication controls should fail securely &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;29&amp;quot;&amp;gt;29.&amp;lt;/span&amp;gt; All administrative and account management functions must be at least as secure as the primary authentication mechanism &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;30&amp;quot;&amp;gt;30.&amp;lt;/span&amp;gt; If your application manages a credential store, it should ensure that only cryptographically strong one-way salted hashes of passwords are stored and that the table/file that stores the passwords and keys is write-able only by the application. (Do not use the MD5 algorithm if it can be avoided) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;31&amp;quot;&amp;gt;31.&amp;lt;/span&amp;gt; Password hashing must be implemented on a trusted system (e.g., The server).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;32&amp;quot;&amp;gt;32.&amp;lt;/span&amp;gt; Validate the authentication data only on completion of all data input, especially for sequential authentication implementations &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;33&amp;quot;&amp;gt;33.&amp;lt;/span&amp;gt; Authentication failure responses should not indicate which part of the authentication data was incorrect. For example, instead of &amp;quot;Invalid username&amp;quot; or &amp;quot;Invalid password&amp;quot;, just use &amp;quot;Invalid username and/or password&amp;quot; for both. Error responses must be truly identical in both display and source code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;34&amp;quot;&amp;gt;34.&amp;lt;/span&amp;gt; Utilize authentication for connections to external systems that involve sensitive information or functions &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;35&amp;quot;&amp;gt;35.&amp;lt;/span&amp;gt; Authentication credentials for accessing services external to the application should be encrypted and stored in a protected location on a trusted system (e.g., The server). The source code is NOT a secure location &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;36&amp;quot;&amp;gt;36.&amp;lt;/span&amp;gt; Use only HTTP POST requests to transmit authentication credentials &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;37&amp;quot;&amp;gt;37.&amp;lt;/span&amp;gt; Only send non-temporary passwords over an encrypted connection or as encrypted data, such as in an encrypted email. Temporary passwords associated with email resets may be an exception &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;38&amp;quot;&amp;gt;38.&amp;lt;/span&amp;gt; Enforce password complexity requirements established by policy or regulation. Authentication credentials should be sufficient to withstand attacks that are typical of the threats in the deployed environment. (e.g., requiring the use of alphabetic as well as numeric and/or special characters)  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;39&amp;quot;&amp;gt;39.&amp;lt;/span&amp;gt; Enforce password length requirements established by policy or regulation. Eight characters is commonly used, but 16 is better or consider the use of multi-word pass phrases &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;40&amp;quot;&amp;gt;40.&amp;lt;/span&amp;gt; Password entry should be obscured on the user's screen. (e.g., on web forms use the input type &amp;quot;password&amp;quot;)  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;41&amp;quot;&amp;gt;41.&amp;lt;/span&amp;gt; Enforce account disabling after an established number of invalid login attempts (e.g., five attempts is common).  The account must be disabled for a period of time sufficient to discourage brute force guessing of credentials, but not so long as to allow for a denial-of-service attack to be performed  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;42&amp;quot;&amp;gt;42.&amp;lt;/span&amp;gt; Password reset and changing operations require the same level of controls as account creation and authentication.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;43&amp;quot;&amp;gt;43.&amp;lt;/span&amp;gt; Password reset questions should support sufficiently random answers. (e.g., &amp;quot;favorite book&amp;quot; is a bad question because “The Bible” is a very common answer) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;44&amp;quot;&amp;gt;44.&amp;lt;/span&amp;gt; If using email based resets, only send email to a pre-registered address with a temporary link/password &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;45&amp;quot;&amp;gt;45.&amp;lt;/span&amp;gt; Temporary passwords and links should have a short expiration time &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;46&amp;quot;&amp;gt;46.&amp;lt;/span&amp;gt; Enforce the changing of temporary passwords on the next use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;47&amp;quot;&amp;gt;47.&amp;lt;/span&amp;gt; Notify users when a password reset occurs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;48&amp;quot;&amp;gt;48.&amp;lt;/span&amp;gt; Prevent password re-use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;49&amp;quot;&amp;gt;49.&amp;lt;/span&amp;gt; Passwords should be at least one day old before they can be changed, to prevent attacks on password re-use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;50&amp;quot;&amp;gt;50.&amp;lt;/span&amp;gt; Enforce password changes based on requirements established in policy or regulation. Critical systems may require more frequent changes. The time between resets must be administratively controlled  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;51&amp;quot;&amp;gt;51.&amp;lt;/span&amp;gt; Disable &amp;quot;remember me&amp;quot; functionality for password fields &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;52&amp;quot;&amp;gt;52.&amp;lt;/span&amp;gt; The last use (successful or unsuccessful) of a user account should be reported to the user at their next successful login &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;53&amp;quot;&amp;gt;53.&amp;lt;/span&amp;gt; Implement monitoring to identify attacks against multiple user accounts, utilizing the same password. This attack pattern is used to bypass standard lockouts, when user IDs can be harvested or guessed &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;54&amp;quot;&amp;gt;54.&amp;lt;/span&amp;gt; Change all vendor-supplied default passwords and user IDs or disable the associated accounts &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;55&amp;quot;&amp;gt;55.&amp;lt;/span&amp;gt; Re-authenticate users prior to performing critical operations &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;56&amp;quot;&amp;gt;56.&amp;lt;/span&amp;gt; Use Multi-Factor Authentication for highly sensitive or high value transactional accounts &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;57&amp;quot;&amp;gt;57.&amp;lt;/span&amp;gt; If using third party code for authentication, inspect the code carefully to ensure it is not affected by any malicious code  &lt;br /&gt;
&lt;br /&gt;
== Session Management ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;58&amp;quot;&amp;gt;58.&amp;lt;/span&amp;gt; Use the server or framework’s session management controls. The application should only recognize these session identifiers as valid &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;59&amp;quot;&amp;gt;59.&amp;lt;/span&amp;gt; Session identifier creation must always be done on a trusted system (e.g., The server) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;60&amp;quot;&amp;gt;60.&amp;lt;/span&amp;gt; Session management controls should use well vetted algorithms that ensure sufficiently random session identifiers &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;61&amp;quot;&amp;gt;61.&amp;lt;/span&amp;gt; Set the domain and path for cookies containing authenticated session identifiers to an appropriately restricted value for the site &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;62&amp;quot;&amp;gt;62.&amp;lt;/span&amp;gt; Logout functionality should fully terminate the associated session or connection &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;63&amp;quot;&amp;gt;63.&amp;lt;/span&amp;gt; Logout functionality should be available from all pages protected by authorization &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;64&amp;quot;&amp;gt;64.&amp;lt;/span&amp;gt; Establish a session inactivity timeout that is as short as possible, based on balancing risk and business functional requirements. In most cases it should be no more than several hours &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;65&amp;quot;&amp;gt;65.&amp;lt;/span&amp;gt; Disallow persistent logins and enforce periodic session terminations, even when the session is active. Especially for applications supporting rich network connections or connecting to critical systems. Termination times should support business requirements and the user should receive sufficient notification to mitigate negative impacts &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;66&amp;quot;&amp;gt;66.&amp;lt;/span&amp;gt; If a session was established before login, close that session and establish a new session after a successful login &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;67&amp;quot;&amp;gt;67.&amp;lt;/span&amp;gt; Generate a new session identifier on any re-authentication &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;68&amp;quot;&amp;gt;68.&amp;lt;/span&amp;gt; Do not allow concurrent logins with the same user ID &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;69&amp;quot;&amp;gt;69.&amp;lt;/span&amp;gt; Do not expose session identifiers in URLs, error messages or logs. Session identifiers should only be located in the HTTP cookie header. For example, do not pass session identifiers as GET parameters &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;70&amp;quot;&amp;gt;70.&amp;lt;/span&amp;gt; Protect server side session data from unauthorized access, by other users of the server, by implementing appropriate access controls on the server &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;71&amp;quot;&amp;gt;71.&amp;lt;/span&amp;gt; Generate a new session identifier and deactivate the old one periodically. (This can mitigate certain session hijacking scenarios where the original identifier was compromised) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;72&amp;quot;&amp;gt;72.&amp;lt;/span&amp;gt; Generate a new session identifier if the connection security changes from HTTP to HTTPS, as can occur during authentication. Within an application, it is recommended to consistently utilize HTTPS rather than switching between HTTP to HTTPS. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;73&amp;quot;&amp;gt;73.&amp;lt;/span&amp;gt; Supplement standard session management for sensitive server-side operations, like account management, by utilizing per-session strong random tokens or parameters. This method can be used to prevent Cross Site Request Forgery attacks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;74&amp;quot;&amp;gt;74.&amp;lt;/span&amp;gt; Supplement standard session management for highly sensitive or critical operations by utilizing per-request, as opposed to per-session, strong random tokens or parameters &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;75&amp;quot;&amp;gt;75.&amp;lt;/span&amp;gt; Set the &amp;quot;secure&amp;quot; attribute for cookies transmitted over an TLS connection &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;76&amp;quot;&amp;gt;76.&amp;lt;/span&amp;gt; Set cookies with the HttpOnly attribute, unless you specifically require client-side scripts within your application to read or set a cookie's value &lt;br /&gt;
&lt;br /&gt;
== Access Control ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;77&amp;quot;&amp;gt;77.&amp;lt;/span&amp;gt; Use only trusted system objects, e.g. server side session objects, for making access authorization decisions  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;78&amp;quot;&amp;gt;78.&amp;lt;/span&amp;gt; Use a single site-wide component to check access authorization. This includes libraries that call external authorization services &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;79&amp;quot;&amp;gt;79.&amp;lt;/span&amp;gt; Access controls should fail securely  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;80&amp;quot;&amp;gt;80.&amp;lt;/span&amp;gt; Deny all access if the application cannot access its security configuration information &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;81&amp;quot;&amp;gt;81.&amp;lt;/span&amp;gt; Enforce authorization controls on every request, including those made by server side scripts, &amp;quot;includes&amp;quot; and requests from rich client-side technologies like AJAX and Flash &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;82&amp;quot;&amp;gt;82.&amp;lt;/span&amp;gt; Segregate privileged logic from other application code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;83&amp;quot;&amp;gt;83.&amp;lt;/span&amp;gt; Restrict access to files or other resources, including those outside the application's direct control, to only authorized users  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;84&amp;quot;&amp;gt;84.&amp;lt;/span&amp;gt; Restrict access to protected URLs to only authorized users  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;85&amp;quot;&amp;gt;85.&amp;lt;/span&amp;gt; Restrict access to protected functions to only authorized users  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;86&amp;quot;&amp;gt;86.&amp;lt;/span&amp;gt; Restrict direct object references to only authorized users  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;87&amp;quot;&amp;gt;87.&amp;lt;/span&amp;gt; Restrict access  to services to only authorized users &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;88&amp;quot;&amp;gt;88.&amp;lt;/span&amp;gt; Restrict access  to application data to only authorized users &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;89&amp;quot;&amp;gt;89.&amp;lt;/span&amp;gt; Restrict access to user and data attributes and policy information used by access controls &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;90&amp;quot;&amp;gt;90.&amp;lt;/span&amp;gt; Restrict access security-relevant configuration information to only authorized users &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;91&amp;quot;&amp;gt;91.&amp;lt;/span&amp;gt; Server side implementation and presentation layer representations of access control rules must match &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;92&amp;quot;&amp;gt;92.&amp;lt;/span&amp;gt; If state data must be stored on the client, use encryption and integrity checking on the server side to catch state tampering.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;93&amp;quot;&amp;gt;93.&amp;lt;/span&amp;gt; Enforce application logic flows to comply with business rules &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;94&amp;quot;&amp;gt;94.&amp;lt;/span&amp;gt; Limit the number of transactions a single user or device can perform in a given period of time. The transactions/time should be above the actual business requirement, but low enough to deter automated attacks &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;95&amp;quot;&amp;gt;95.&amp;lt;/span&amp;gt; Use the &amp;quot;referer&amp;quot; header as a supplemental check only, it should never be the sole authorization check, as it is can be spoofed &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;96&amp;quot;&amp;gt;96.&amp;lt;/span&amp;gt; If long authenticated sessions are allowed, periodically re-validate a user’s authorization to ensure that their privileges have not changed and if they have, log the user out and force them to re-authenticate &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;97&amp;quot;&amp;gt;97.&amp;lt;/span&amp;gt; Implement account auditing and enforce the disabling of unused accounts (e.g., After no more than 30 days from the expiration of an account’s password.) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;98&amp;quot;&amp;gt;98.&amp;lt;/span&amp;gt; The application must support disabling of accounts and terminating sessions when authorization ceases (e.g., Changes to role, employment status, business process, etc.) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;99&amp;quot;&amp;gt;99.&amp;lt;/span&amp;gt; Service accounts or accounts supporting connections to or from external systems should have the least privilege possible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;100&amp;quot;&amp;gt;100.&amp;lt;/span&amp;gt; Create an Access Control Policy to document an application's business rules, data types and access authorization criteria and/or processes so that access can be properly provisioned and controlled. This includes identifying access requirements for both the data and system resources &lt;br /&gt;
&lt;br /&gt;
== Cryptographic Practices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;101&amp;quot;&amp;gt;101.&amp;lt;/span&amp;gt; All cryptographic functions used to protect secrets from the application user must be implemented on a trusted system (e.g., The server) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;102&amp;quot;&amp;gt;102.&amp;lt;/span&amp;gt; Protect master secrets from unauthorized access &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;103&amp;quot;&amp;gt;103.&amp;lt;/span&amp;gt; Cryptographic modules should fail securely &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;104&amp;quot;&amp;gt;104.&amp;lt;/span&amp;gt; All random numbers, random file names, random GUIDs, and random strings should be generated using the cryptographic module’s approved random number generator when these random values are intended to be un-guessable &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;105&amp;quot;&amp;gt;105.&amp;lt;/span&amp;gt; Cryptographic modules used by the application should be compliant to FIPS 140-2 or an equivalent standard. (See http://csrc.nist.gov/groups/STM/cmvp/validation.html) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;106&amp;quot;&amp;gt;106.&amp;lt;/span&amp;gt; Establish and utilize a policy and process for how cryptographic keys will be managed  &lt;br /&gt;
&lt;br /&gt;
== Error Handling and Logging ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;107&amp;quot;&amp;gt;107.&amp;lt;/span&amp;gt; Do not disclose sensitive information in error responses, including system details, session identifiers or account information &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;108&amp;quot;&amp;gt;108.&amp;lt;/span&amp;gt; Use error handlers that do not display debugging or stack trace information &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;109&amp;quot;&amp;gt;109.&amp;lt;/span&amp;gt; Implement generic error messages and use custom error pages  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;110&amp;quot;&amp;gt;110.&amp;lt;/span&amp;gt; The application should handle application errors and not rely on the server configuration &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;111&amp;quot;&amp;gt;111.&amp;lt;/span&amp;gt; Properly free allocated memory when error conditions occur &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;112&amp;quot;&amp;gt;112.&amp;lt;/span&amp;gt; Error handling logic associated with security controls should deny access by default &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;113&amp;quot;&amp;gt;113.&amp;lt;/span&amp;gt; All logging controls should be implemented on a trusted system (e.g., The server) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;114&amp;quot;&amp;gt;114.&amp;lt;/span&amp;gt; Logging controls should support both success and failure of specified security events &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;115&amp;quot;&amp;gt;115.&amp;lt;/span&amp;gt; Ensure logs contain important log event data &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;116&amp;quot;&amp;gt;116.&amp;lt;/span&amp;gt; Ensure log entries that include un-trusted data will not execute as code in the intended log viewing interface or software &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;117&amp;quot;&amp;gt;117.&amp;lt;/span&amp;gt; Restrict access to logs to only authorized individuals &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;118&amp;quot;&amp;gt;118.&amp;lt;/span&amp;gt; Utilize a master routine for all logging operations &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;119&amp;quot;&amp;gt;119.&amp;lt;/span&amp;gt; Do not store sensitive information in logs, including unnecessary system details, session identifiers or passwords &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;120&amp;quot;&amp;gt;120.&amp;lt;/span&amp;gt; Ensure that a mechanism exists to conduct log analysis &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;121&amp;quot;&amp;gt;121.&amp;lt;/span&amp;gt; Log all input validation failures &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;122&amp;quot;&amp;gt;122.&amp;lt;/span&amp;gt; Log all authentication attempts, especially failures &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;123&amp;quot;&amp;gt;123.&amp;lt;/span&amp;gt; Log all access control failures &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;124&amp;quot;&amp;gt;124.&amp;lt;/span&amp;gt; Log all apparent tampering events, including unexpected changes to state data &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;125&amp;quot;&amp;gt;125.&amp;lt;/span&amp;gt; Log attempts to connect with invalid or expired session tokens &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;126&amp;quot;&amp;gt;126.&amp;lt;/span&amp;gt; Log all system exceptions &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;127&amp;quot;&amp;gt;127.&amp;lt;/span&amp;gt; Log all administrative functions, including changes to the security configuration settings &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;128&amp;quot;&amp;gt;128.&amp;lt;/span&amp;gt; Log all backend TLS connection failures &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;129&amp;quot;&amp;gt;129.&amp;lt;/span&amp;gt; Log cryptographic module failures &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;130&amp;quot;&amp;gt;130.&amp;lt;/span&amp;gt; Use a cryptographic hash function to validate log entry integrity Data Protection: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;131&amp;quot;&amp;gt;131.&amp;lt;/span&amp;gt; Implement least privilege, restrict users to only the functionality, data and system information that is required to perform their tasks &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;132&amp;quot;&amp;gt;132.&amp;lt;/span&amp;gt; Protect all cached or temporary copies of sensitive data stored on the server from unauthorized access and purge those temporary working files a soon as they are no longer required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;133&amp;quot;&amp;gt;133.&amp;lt;/span&amp;gt; Encrypt highly sensitive stored information, like authentication verification data, even on the server side. Always use well vetted algorithms, see &amp;quot;Cryptographic Practices&amp;quot; for additional guidance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;134&amp;quot;&amp;gt;134.&amp;lt;/span&amp;gt; Protect server-side source-code from being downloaded by a user &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;135&amp;quot;&amp;gt;135.&amp;lt;/span&amp;gt; Do not store passwords, connection strings or other sensitive information in clear text or in any non-cryptographically secure manner on the client side. This includes embedding in insecure formats like: MS viewstate, Adobe flash or compiled code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;136&amp;quot;&amp;gt;136.&amp;lt;/span&amp;gt; Remove comments in user accessible production code that may reveal backend system or other sensitive information &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;137&amp;quot;&amp;gt;137.&amp;lt;/span&amp;gt; Remove unnecessary application and system documentation as this can reveal useful information to attackers &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;138&amp;quot;&amp;gt;138.&amp;lt;/span&amp;gt; Do not include sensitive information in HTTP GET request parameters &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;139&amp;quot;&amp;gt;139.&amp;lt;/span&amp;gt; Disable auto complete features on forms expected to contain sensitive information, including authentication   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;140&amp;quot;&amp;gt;140.&amp;lt;/span&amp;gt; Disable client side caching on pages containing sensitive information. Cache-Control: no-store, may be used in conjunction with the HTTP header control &amp;quot;Pragma: no-cache&amp;quot;, which is less effective, but is HTTP/1.0 backward compatible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;141&amp;quot;&amp;gt;141.&amp;lt;/span&amp;gt; The application should support the removal of sensitive data when that data is no longer required. (e.g. personal information or certain financial data) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;142&amp;quot;&amp;gt;142.&amp;lt;/span&amp;gt; Implement appropriate access controls for sensitive data stored on the server. This includes cached data, temporary files and data that should be accessible only by specific system users &lt;br /&gt;
&lt;br /&gt;
== Communication Security ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;143&amp;quot;&amp;gt;143.&amp;lt;/span&amp;gt; Implement encryption for the transmission of all sensitive information. This should include TLS for protecting the connection and may be supplemented by discrete encryption of sensitive files or non-HTTP based connections &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;144&amp;quot;&amp;gt;144.&amp;lt;/span&amp;gt; TLS certificates should be valid and have the correct domain name, not be expired, and be installed with intermediate certificates when required &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;145&amp;quot;&amp;gt;145.&amp;lt;/span&amp;gt; Failed TLS connections should not fall back to an insecure connection &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;146&amp;quot;&amp;gt;146.&amp;lt;/span&amp;gt; Utilize TLS connections for all content requiring authenticated access and for all other sensitive information &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;147&amp;quot;&amp;gt;147.&amp;lt;/span&amp;gt; Utilize TLS for connections to external systems that involve sensitive information or functions &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;148&amp;quot;&amp;gt;148.&amp;lt;/span&amp;gt; Utilize a single standard TLS implementation that is configured appropriately &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;149&amp;quot;&amp;gt;149.&amp;lt;/span&amp;gt; Specify character encodings for all connections &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;150&amp;quot;&amp;gt;150.&amp;lt;/span&amp;gt; Filter parameters containing sensitive information from the HTTP referer, when linking to external sites &lt;br /&gt;
 &lt;br /&gt;
== System Configuration ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;151&amp;quot;&amp;gt;151.&amp;lt;/span&amp;gt; Ensure servers, frameworks and system components are running the latest approved version  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;152&amp;quot;&amp;gt;152.&amp;lt;/span&amp;gt; Ensure servers, frameworks and system components have all patches issued for the version in use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;153&amp;quot;&amp;gt;153.&amp;lt;/span&amp;gt; Turn off directory listings &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;154&amp;quot;&amp;gt;154.&amp;lt;/span&amp;gt; Restrict the web server, process and service accounts to the least privileges possible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;155&amp;quot;&amp;gt;155.&amp;lt;/span&amp;gt; When exceptions occur, fail securely &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;156&amp;quot;&amp;gt;156.&amp;lt;/span&amp;gt; Remove all unnecessary functionality and files &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;157&amp;quot;&amp;gt;157.&amp;lt;/span&amp;gt; Remove test code or any functionality not intended for production, prior to deployment &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;158&amp;quot;&amp;gt;158.&amp;lt;/span&amp;gt; Prevent disclosure of your directory structure in the robots.txt file by placing directories not intended for public indexing into an isolated parent directory. Then &amp;quot;Disallow&amp;quot; that entire parent directory in the robots.txt file rather than Disallowing each individual directory &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;159&amp;quot;&amp;gt;159.&amp;lt;/span&amp;gt; Define which HTTP methods, Get or Post, the application will support and whether it will be handled differently in different pages in the application &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;160&amp;quot;&amp;gt;160.&amp;lt;/span&amp;gt; Disable unnecessary HTTP methods, such as WebDAV extensions. If an extended HTTP method that supports file handling is required, utilize a well-vetted authentication mechanism &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;161&amp;quot;&amp;gt;161.&amp;lt;/span&amp;gt; If the web server handles both HTTP 1.0 and 1.1, ensure that both are configured in a similar manor or insure that you understand any difference that may exist (e.g. handling of extended HTTP methods)  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;162&amp;quot;&amp;gt;162.&amp;lt;/span&amp;gt; Remove unnecessary information from HTTP response headers related to the OS, web-server version and application frameworks  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;163&amp;quot;&amp;gt;163.&amp;lt;/span&amp;gt; The security configuration store for the application should be able to be output in human readable form to support auditing &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;164&amp;quot;&amp;gt;164.&amp;lt;/span&amp;gt; Implement an asset management system and register system components and software in it &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;165&amp;quot;&amp;gt;165.&amp;lt;/span&amp;gt; Isolate development environments from the production network and provide access only to authorized development and test groups. Development environments are often configured less securely than production environments and attackers may use this difference to discover shared weaknesses or as an avenue for exploitation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;166&amp;quot;&amp;gt;166.&amp;lt;/span&amp;gt; Implement a software change control system to manage and record changes to the code both in development and production &lt;br /&gt;
&lt;br /&gt;
== Database Security ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;167&amp;quot;&amp;gt;167.&amp;lt;/span&amp;gt; Use strongly typed parameterized queries  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;168&amp;quot;&amp;gt;168.&amp;lt;/span&amp;gt; Utilize input validation and output encoding and be sure to address meta characters. If these fail, do not run the database command &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;169&amp;quot;&amp;gt;169.&amp;lt;/span&amp;gt; Ensure that variables are strongly typed &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;170&amp;quot;&amp;gt;170.&amp;lt;/span&amp;gt; The application should use the lowest possible level of privilege when accessing the database &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;171&amp;quot;&amp;gt;171.&amp;lt;/span&amp;gt; Use secure credentials for database access &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;172&amp;quot;&amp;gt;172.&amp;lt;/span&amp;gt; Connection strings should not be hard coded within the application. Connection strings should be stored in a separate configuration file on a trusted system and they should be encrypted. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;173&amp;quot;&amp;gt;173.&amp;lt;/span&amp;gt; Use stored procedures to abstract data access and allow for the removal of permissions to the base tables in the database &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;174&amp;quot;&amp;gt;174.&amp;lt;/span&amp;gt; Close the connection as soon as possible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;175&amp;quot;&amp;gt;175.&amp;lt;/span&amp;gt; Remove or change all default database administrative passwords. Utilize strong passwords/phrases or implement multi-factor authentication &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;176&amp;quot;&amp;gt;176.&amp;lt;/span&amp;gt; Turn off all unnecessary database functionality (e.g., unnecessary stored procedures or services, utility packages, install only the minimum set of features and options required (surface area reduction))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;177&amp;quot;&amp;gt;177.&amp;lt;/span&amp;gt; Remove unnecessary default vendor content (e.g., sample schemas) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;178&amp;quot;&amp;gt;178.&amp;lt;/span&amp;gt; Disable any default accounts that are not required to support business requirements &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;179&amp;quot;&amp;gt;179.&amp;lt;/span&amp;gt; The application should connect to the database with different credentials for every trust distinction (e.g., user, read-only user, guest, administrators) &lt;br /&gt;
 &lt;br /&gt;
== File Management ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;180&amp;quot;&amp;gt;180.&amp;lt;/span&amp;gt; Do not pass user supplied data directly to any dynamic include function &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;181&amp;quot;&amp;gt;181.&amp;lt;/span&amp;gt; Require authentication before allowing a file to be uploaded &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;182&amp;quot;&amp;gt;182.&amp;lt;/span&amp;gt; Limit the type of files that can be uploaded to only those types that are needed for business purposes &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;183&amp;quot;&amp;gt;183.&amp;lt;/span&amp;gt; Validate uploaded files are the expected type by checking file headers. Checking for file type by extension alone is not sufficient &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;184&amp;quot;&amp;gt;184.&amp;lt;/span&amp;gt; Do not save files in the same web context as the application. Files should either go to the content server or in the database.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;185&amp;quot;&amp;gt;185.&amp;lt;/span&amp;gt; Prevent or restrict the uploading of any file that may be interpreted by the web server.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;186&amp;quot;&amp;gt;186.&amp;lt;/span&amp;gt; Turn off execution privileges on file upload directories &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;187&amp;quot;&amp;gt;187.&amp;lt;/span&amp;gt; Implement safe uploading in UNIX by mounting the targeted file directory as a logical drive using the associated path or the chrooted environment &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;188&amp;quot;&amp;gt;188.&amp;lt;/span&amp;gt; When referencing existing files, use a white list of allowed file names and types. Validate the value of the parameter being passed and if it does not match one of the expected values, either reject it or use a hard coded default file value for the content instead &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;189&amp;quot;&amp;gt;189.&amp;lt;/span&amp;gt; Do not pass user supplied data into a dynamic redirect. If this must be allowed, then the redirect should accept only validated, relative path URLs  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;190&amp;quot;&amp;gt;190.&amp;lt;/span&amp;gt; Do not pass directory or file paths, use index values mapped to pre-defined list of paths &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;191&amp;quot;&amp;gt;191.&amp;lt;/span&amp;gt; Never send the absolute file path to the client &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;192&amp;quot;&amp;gt;192.&amp;lt;/span&amp;gt; Ensure application files and resources are read-only &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;193&amp;quot;&amp;gt;193.&amp;lt;/span&amp;gt; Scan user uploaded files for viruses and malware &lt;br /&gt;
 &lt;br /&gt;
== Memory Management ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;194&amp;quot;&amp;gt;194.&amp;lt;/span&amp;gt; Utilize input and output control for un-trusted data &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;195&amp;quot;&amp;gt;195.&amp;lt;/span&amp;gt; Double check that the buffer is as large as specified  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;196&amp;quot;&amp;gt;196.&amp;lt;/span&amp;gt; When using functions that accept a number of bytes to copy, such as strncpy(), be aware that if the destination buffer size is equal to the source buffer size, it may not NULL-terminate the string &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;197&amp;quot;&amp;gt;197.&amp;lt;/span&amp;gt; Check buffer boundaries if calling the function in a loop and make sure there is no danger of writing past the allocated space &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;198&amp;quot;&amp;gt;198.&amp;lt;/span&amp;gt; Truncate all input strings to a reasonable length before passing them to the copy and concatenation functions &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;199&amp;quot;&amp;gt;199.&amp;lt;/span&amp;gt; Specifically close resources, don’t rely on garbage collection. (e.g., connection objects, file handles, etc.) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;200&amp;quot;&amp;gt;200.&amp;lt;/span&amp;gt; Use non-executable stacks when available &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;201&amp;quot;&amp;gt;201.&amp;lt;/span&amp;gt; Avoid the use of known vulnerable functions (e.g., printf, strcat, strcpy etc.)  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;202&amp;quot;&amp;gt;202.&amp;lt;/span&amp;gt; Properly free allocated memory upon the completion of functions and at all exit points &lt;br /&gt;
&lt;br /&gt;
== General Coding Practices ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;203&amp;quot;&amp;gt;203.&amp;lt;/span&amp;gt; Use tested and approved managed code rather than creating new unmanaged code for common tasks &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;204&amp;quot;&amp;gt;204.&amp;lt;/span&amp;gt; Utilize task specific built-in APIs to conduct operating system tasks. Do not allow the application to issue commands directly to the Operating System, especially through the use of application initiated command shells &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;205&amp;quot;&amp;gt;205.&amp;lt;/span&amp;gt; Use checksums or hashes to verify the integrity of interpreted code, libraries, executables, and configuration files  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;206&amp;quot;&amp;gt;206.&amp;lt;/span&amp;gt; Utilize locking to prevent multiple simultaneous requests or use a synchronization mechanism to prevent race conditions &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;207&amp;quot;&amp;gt;207.&amp;lt;/span&amp;gt; Protect shared variables and resources from inappropriate concurrent access &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;208&amp;quot;&amp;gt;208.&amp;lt;/span&amp;gt; Explicitly initialize all your variables and other data stores, either during declaration or just before the first usage &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;209&amp;quot;&amp;gt;209.&amp;lt;/span&amp;gt; In cases where the application must run with elevated privileges, raise privileges as late as possible, and drop them as soon as possible &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;210&amp;quot;&amp;gt;210.&amp;lt;/span&amp;gt; Avoid calculation errors by understanding your programming language's underlying representation and how it interacts with numeric calculation. Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, &amp;quot;not-a-number&amp;quot; calculations, and how your language handles numbers that are too large or too small for its underlying representation &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;211&amp;quot;&amp;gt;211.&amp;lt;/span&amp;gt; Do not pass user supplied data to any dynamic execution function &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;212&amp;quot;&amp;gt;212.&amp;lt;/span&amp;gt; Restrict users from generating new code or altering existing code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;213&amp;quot;&amp;gt;213.&amp;lt;/span&amp;gt; Review all secondary applications, third party code and libraries to determine business necessity and validate safe functionality, as these can introduce new vulnerabilities &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;214&amp;quot;&amp;gt;214.&amp;lt;/span&amp;gt; Implement safe updating. If the application will utilize automatic updates, then use cryptographic signatures for your code and ensure your download clients verify those signatures. Use encrypted channels to transfer the code from the host server&lt;/div&gt;</summary>
		<author><name>Dariodf</name></author>	</entry>

	</feed>