I recently received the results of a security audit on my application, and there were several weaknesses that I couldn't figure out how to plug. Are there settings I could change for any of the following situations?
(1) When authenticating a user, the application does not assign a new session identifier, but reuses the existing session identifier created before the authentication step. The attack consists in causing a legitimate user to authenticate with a session identifier known to the attacker, and then usurp the session once authenticated using this same identifier. The attacker must create or retrieve a valid session ID and have the victim's browser use it. Depending on the case, this can be done by transmitting the identifier as a URL argument, in a hidden form field or through cookies. *** I see that there is generated code saying "s_web._SitesQueue.Defaults.ChangeSessionOnLogInOut = 1", wouldn't that have prevented this? ***
(2) HTTP header injection in the server response. An injection of HTTP header is possible when user input is returned without being properly escaped in a response header. If a carriage return is retranscribed as is from the request to a response header, an attacker could modify the contents of the following headers, see write a completely different server response. Any Cross-Site Scripting (XSS) attack can usually be reproduced by a header injection, forcing the execution of arbitrary JavaScript. This type of vulnerability can also be used to poison the cache of a proxy serving as an intermediary for users to access the application. Finally, this type of vulnerability can make it possible to pass certain restrictions on authentication flows (CSP / CORS) and the origin of accepted scripts.
(3) Attack by Cross Site Scripting (XSS by Reflection). Parameter values sent by the client browser to the web application are not sufficiently controlled, which could allow an attacker to inject HTML or JavaScript into it. Indeed, the interpretable characters, such as <,>, /, ', ", etc. are not encoded before they are integrated with the response to the client. This vulnerability could be exploited by an attacker to conduct a Cross-Site Scripting (XSS) attack, in order to execute code in the context of the victim's web browser. This type of attack is usually used to access session cookies, allowing the attacker to impersonate the victim on the application.
(4) Denial of service by renegotiation SSL / TLS. The TLS / SSL service allows renegotiation of sessions initiated by the client. Session renegotiation is an operation that requires a larger amount of computation on the server side than the client side, depending on the algorithm used. An attacker could exploit this phenomenon by requesting a large number of renegotiations of concurrent SSL / TLS sessions in order to trigger a denial of service, bypassing, for example, the mitigations limiting the number of TCP sessions opened by IP (only one TCP session needed for this attack). *** Is there a way to limit the number of attempts? ***
(5) Value of session cookies predictable or insufficiently random. Cookies are files stored by the web browser of the visitor to a website and which serve (among other things) to identify a user in time, to prevent him from returning to each page his username and password. However, when the cookie values are predictable or insufficiently random, an attacker can potentially impersonate a user by recreating the cookie on their own machine. The auditors noted the possibility of limiting the complexity of the session token returned by the application at the time of authentication. In addition to the acceptance of session cookies presented in TEC.WEB.018, the session token seems to conform to the size and composition of the one provided by the user:
Indeed, if the client provides, at the moment of authentication, a cookie of 2 uppercase letters, the returned cookie will also consist of 2 capital letters. Recommend modifying the application providing the session cookies so that the value of the latter follows a random distribution. *** I have the session ID length set to 30, is this not the same thing? ***
Issues with possible solutions:
(1) Problem: BEAST Vulnerability (TLSv1.0 with CBC), Vulnerability LUCKY13 (CBC with TLS). LUCKY13 is a time attack against TLS implementations using the weaknesses of the CBC mode (block ciphering). The attack allows the decryption of TLS traffic. Details of the attack can be found at
https://eprint.iacr.org/2015/1129.pdf. BEAST is an attack against the TLSv1.0 protocol using weaknesses in the CBC mode (block ciphering). The attack decrypts the SSL / TLS traffic. Full details of the attack can be found in the paper "Here Come The XOR Ninjas" by Thai Duong and Juliano Rizzo, available at:
https://bug665814.bmoattachments.org/attachment.cgi?id=540839 ... Solution: In ThisWebServer.Open, set SELF.SSLMethod = NET:SSLMethodTLS_PCI