Posts

Apache header directives for security

This is a list of header directives for to increment security site. You have two ways for set this security header, from .htacess or from your web server. Example using ".htaccess"  <IfModule mod_headers.c>      Header set X-Frame-Options "DENY"  </IfModule>   You can set using "Header set" followed by header policy.  This is a list from more commons.   Content-Security-Policy Examples 1  <IfModule mod_headers.c>     Header set Content-Security-Policy "default-src 'self' style-src 'self' 'unsafe-inline' fonts.googleapis.com script-src 'self' font-src 'self' fonts.gstatic.com "  </IfModule>   You can find a complete documentation on this link:  Directives for bootstrap  https://content-security-policy.com/examples/google-fonts/ https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy  Strict Transp...

Code Correctness: Untested Functionality

Summary During security testing of the target application, some of the functionality was found to be inoperable. As such, any potential security vulnerabilities associated with this functionality could not be evaluated and its controls could not be verified. Explanation Gaps in testing coverage could leave significant vulnerabilities unreported, leading to a false sense of security while leaving the application open to attack and/or compromise. Recommendation Ensure that all key application functionality is operational and ready for security testing to ensure completeness of coverage.

Poor Error Handling: Unhandled Exception

Summary Unhandled exceptions are circumstances in which the application has received user input that it did not expect and does not know how to handle. When successfully exploited, an attacker can gain unauthorized access to the database by using the information recovered from seemingly innocuous error messages to pinpoint flaws in the web application and to discover additional  venues of attack. Recommendations include designing and adding consistent error-handling mechanisms that are capable of handling any user input to your web application, providing meaningful detail to end-users, and preventing error messages that might provide information useful to an attacker from being displayed. Description The most common cause of an unhandled exception is a failure to properly sanitize client-supplied data that is used in SQL statements. They can also be caused by a bug in the web application's database communication code, a misconfiguration of database connection settings, an unavailab...

Cache Management: Insecure Policy

Image
Summary SSL contents on this site can be cached by browser or intermediate proxy server cache. Explanation SSL provides secure encrypted channel to transfer information from source to user. The information server over SSL is considered sensitive and trusted to be only available to requestor. However, caching these content on disk in temporary internet files or in intermediate proxy server can compromise that trust by exposing it to everyone who has access to these temporary storage or proxy cache. Hence these content served over SSL should have cache disabled. Execution Send a request to https://yourdomain.com:443/site/login and inspect the Cache-Control header value. Recommendation Set Cache-Control directive to private, no-cache and/or no-store. private This directive allows the server to prevent a shared cache from caching responses that are intended for a single user. The mechanism can be used to ensure that privileged information is not accidentally leaked to unauthorized users. T...

HTML5 : Cross-Site Scripting Protection

Image
Summary X-XSS-Protection HTTP response header enables developers and security architects to manage browser protection against reflected cross-site scripting. The mechanism is also known as the XSS Auditor in Chrome and the XSS filter in Internet Explorer. In modern browsers, the Content-SecurityPolicy header can provide better protection against XSS and setting X-XSS-Protection might be redundant. However, this header can reduce the risk of reflected XSS attacks in earlier browsers that do not support CSP. This header can be set to one of three possible values: 0 , 1 , or 1 ; mode=block . A value of 0 disables the protection. A value of 1 is the default behaviour in modern browsers that enables the protection in filter or replacement mode. For example, IE replaces JavaScript keywords such as <script> with <scr#pt> to render injected string ineffective. The value of 1 ; mode=block instructs browsers to block the response from rendering in the browser. Reports of multiple exp...

Web Server Misconfiguration: Insecure Content-Type Setting

Image
Summary Almost all browsers are designed to use a mime sniffing technique to guess the content type of the HTTP response instead of adhering to the Content-Type specified by the application in specific cases or ignoring the content when no mime type is specified. Inconsistencies introduced by the mime sniffing techniques could allow attackers to conduct Cross-Site Scripting attacks or steal sensitive user data. WebInspect has determined that the application fails to instruct the browser to strictly enforce the Content-Type specification supplied in the response. Web server misconfiguration can cause an application to send HTTP responses with the missing Content-Type header or specify a mime type that does not match up accurately with the response content. When a browser receives such a response, it attempts to programmatically determine the mime type based on the content returned in the response. The mime type derived by the browser, however, might not accurately match the one intended...

Privacy Violation : Autocomplete

Summary Most recent browsers have features that will save password field content entered by users and then automatically complete password entry the next time the field are encountered. This feature is enabled by default and could leak password since it is stored on the hard drive of the user. The risk of this issue is greatly increased if users are accessing the application from a shared environment. Recommendations include setting autocomplete to "off" on all your password fields. Please Note: Recent versions of most browsers, as noted below, now ignore the autocomplete="off" attribute for password fields in html forms. Users are allowed to decide the password policy at their own discretion using the password manager. Although setting is ineffective on these versions of browsers, it would continue to protect website users of earlier versions of these and other browsers that support this attribute. Browsers NOT Supporting autocomplete="off": 1. Internet E...