<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=John+Keller</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=John+Keller"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/John_Keller"/>
		<updated>2026-05-07T13:19:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Session_Management_Cheat_Sheet&amp;diff=152468</id>
		<title>Session Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Management_Cheat_Sheet&amp;diff=152468"/>
				<updated>2013-05-29T19:31:02Z</updated>
		
		<summary type="html">&lt;p&gt;John Keller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction  =&lt;br /&gt;
&lt;br /&gt;
'''Web Authentication, Session Management, and Access Control''' &lt;br /&gt;
&lt;br /&gt;
A web session is a sequence of network HTTP request and response transactions associated to the same user. Modern and complex web applications require the retaining of information or status about each user for the duration of multiple requests. Therefore, sessions provide the ability to establish variables – such as access rights and localization settings – which will apply to each and every interaction a user has with the web application for the duration of the session. &lt;br /&gt;
&lt;br /&gt;
Web applications can create sessions to keep track of anonymous users after the very first user request. An example would be maintaining the user language preference. Additionally, web applications will make use of sessions once the user has authenticated. This ensures the ability to identify the user on any subsequent requests as well as being able to apply security access controls, authorized access to the user private data, and to increase the usability of the application. Therefore, current web applications can provide session capabilities both pre and post authentication. &lt;br /&gt;
&lt;br /&gt;
Once an authenticated session has been established, the session ID (or token) is temporarily equivalent to the strongest authentication method used by the application, such as username and password, passphrases, one-time passwords (OTP), client-based digital certificates, smartcards, or biometrics (such as fingerprint or eye retina). See the OWASP Authentication Cheat Sheet: [https://www.owasp.org/index.php/Authentication_Cheat_Sheet https://www.owasp.org/index.php/Authentication_Cheat_Sheet]. &lt;br /&gt;
&lt;br /&gt;
HTTP is a stateless protocol (RFC2616 [5]), where each request and response pair is independent of other web interactions. Therefore, in order to introduce the concept of a session, it is required to implement session management capabilities that link both the authentication and access control (or authorization) modules commonly available in web applications: &lt;br /&gt;
&lt;br /&gt;
[[Image:Session-Management-Diagram Cheat-Sheet.png|center|Session-Management-Diagram Cheat-Sheet.png]] &amp;lt;br&amp;gt; The session ID or token binds the user authentication credentials (in the form of a user session) to the user HTTP traffic and the appropriate access controls enforced by the web application. The complexity of these three components (authentication, session management, and access control) in modern web applications, plus the fact that its implementation and binding resides on the web developer’s hands (as web development framework do not provide strict relationships between these modules), makes the implementation of a secure session management module very challenging. &lt;br /&gt;
&lt;br /&gt;
The disclosure, capture, prediction, brute force, or fixation of the session ID will lead to session hijacking (or sidejacking) attacks, where an attacker is able to fully impersonate a victim user in the web application. Attackers can perform two types of session hijacking attacks, targeted or generic. In a targeted attack, the attacker’s goal is to impersonate a specific (or privileged) web application victim user. For  generic attacks, the attacker’s goal is to impersonate (or get access as) any valid or legitimate user in the web application. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session ID Properties  =&lt;br /&gt;
&lt;br /&gt;
In order to keep the authenticated state and track the users progress within the web application, applications provide users with a session identifier (session ID or token) that is assigned at session creation time, and is shared and exchanged by the user and the web application for the duration of the session (it is sent on every HTTP request). The session ID is a “name=value” pair. &lt;br /&gt;
&lt;br /&gt;
With the goal of implementing secure session IDs, the generation of identifiers (IDs or tokens) must meet the following properties: &lt;br /&gt;
&lt;br /&gt;
== Session ID Name Fingerprinting  ==&lt;br /&gt;
&lt;br /&gt;
The name used by the session ID should not be extremely descriptive nor offer unnecessary details about the purpose and meaning of the ID. &lt;br /&gt;
&lt;br /&gt;
The session ID names used by the most common web application development frameworks can be easily fingerprinted [0], such as PHPSESSID (PHP), JSESSIONID (J2EE), CFID &amp;amp;amp; CFTOKEN (ColdFusion), ASP.NET_SessionId (ASP .NET), etc. Therefore, the session ID name can disclose the technologies and programming languages used by the web application. &lt;br /&gt;
&lt;br /&gt;
It is recommended to change the default session ID name of the web development framework to a generic name, such as “id”. &lt;br /&gt;
&lt;br /&gt;
== Session ID Length  ==&lt;br /&gt;
&lt;br /&gt;
The session ID must be long enough to prevent brute force attacks, where an attacker can go through the whole range of ID values and verify the existence of valid sessions. &lt;br /&gt;
&lt;br /&gt;
The session ID length must be at least 128 bits (16 bytes). &lt;br /&gt;
&lt;br /&gt;
== Session ID Entropy  ==&lt;br /&gt;
&lt;br /&gt;
The session ID must be unpredictable (random enough) to prevent guessing attacks, where an attacker is able to guess or predict the ID of a valid session through statistical analysis techniques. For this purpose, a good PRNG (Pseudo Random Number Generator) must be used. &lt;br /&gt;
&lt;br /&gt;
The session ID value must provide at least 64 bits of entropy (if a good PRNG is used, this value is estimated to be half the length of the session ID).&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''''NOTE''''': The session ID entropy is really affected by other external and difficult to measure factors, such as the number of concurrent active sessions the web application commonly has, the absolute session expiration timeout, the amount of session ID guesses per second the attacker can make and the target web application can support, etc [2]. If a session ID with an entropy of 64 bits is used, it will take an attacker at least 292 years to successfully guess a valid session ID, assuming the attacker can try 10,000 guesses per second with 100,000 valid simultaneous sessions available in the web application [2]. &lt;br /&gt;
&lt;br /&gt;
== Session ID Content (or Value)  ==&lt;br /&gt;
&lt;br /&gt;
The session ID content (or value) must be meaningless to prevent information disclosure attacks, where an attacker is able to decode the contents of the ID and extract details of the user, the session, or the inner workings of the web application. &lt;br /&gt;
&lt;br /&gt;
The session ID must simply be an identifier on the client side, and its value must never include sensitive information (or PII). The meaning and business or application logic associated to the session ID must be stored on the server side, and specifically, in session objects or in a session management database or repository. The stored information can include the client IP address, User-Agent, e-mail, username, user ID, role, privilege level, access rights, language preferences, account ID, current state, last login, session timeouts, and other internal session details. If the session objects and properties contain sensitive information, such as credit card numbers, it is required to duly encrypt and protect the session management repository. &lt;br /&gt;
&lt;br /&gt;
It is recommended to create cryptographically strong session IDs through the usage of cryptographic hash functions such as SHA1 (160 bits). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Management Implementation  =&lt;br /&gt;
&lt;br /&gt;
The session management implementation defines the exchange mechanism that will be used between the user and the web application to share and continuously exchange the session ID. There are multiple mechanisms available in HTTP to maintain session state within web applications, such as cookies (standard HTTP header), URL parameters (URL rewriting – RFC 2396), URL arguments on GET requests, body arguments on POST requests, such as hidden form fields (HTML forms), or proprietary HTTP headers. &lt;br /&gt;
&lt;br /&gt;
The preferred session ID exchange mechanism should allow defining advanced token properties, such as the token expiration date and time, or granular usage constraints. This is one of the reasons why cookies (RFCs 2109 &amp;amp;amp; 2965 &amp;amp;amp; 6265 [1]) are one of the most extensively used session ID exchange mechanisms, offering advanced capabilities not available in other methods. &lt;br /&gt;
&lt;br /&gt;
The usage of specific session ID exchange mechanisms, such as those where the ID is included in the URL, might disclose the session ID (in web links and logs, web browser history and bookmarks, the Referer header or search engines), as well as facilitate other attacks, such as the manipulation of the ID or session fixation attacks [3]. &lt;br /&gt;
&lt;br /&gt;
== Built-in Session Management Implementations  ==&lt;br /&gt;
&lt;br /&gt;
Web development frameworks, such as J2EE, ASP .NET, PHP, and others, provide their own session management features and associated implementation. It is recommended to use these built-in frameworks versus building a home made one from scratch, as they are used worldwide on multiple web environments and have been tested by the web application security and development communities over time. &lt;br /&gt;
&lt;br /&gt;
However, be advised that these frameworks have also presented vulnerabilities and weaknesses in the past, so it is always recommended to use the latest version available, that potentially fixes all the well-known vulnerabilities, as well as review and change the default configuration to enhance its security by following the recommendations described along this document. &lt;br /&gt;
&lt;br /&gt;
The storage capabilities or repository used by the session management mechanism to temporarily save the session IDs must be secure, protecting the session IDs against local or remote accidental disclosure or unauthorized access. &lt;br /&gt;
&lt;br /&gt;
== Used vs. Accepted Session ID Exchange Mechanisms  ==&lt;br /&gt;
&lt;br /&gt;
A specific web application can make use of a particular session ID exchange mechanism by default, such as cookies. However, if a user submits a session ID through a different exchange mechanism, such as a URL parameter, the web application might accept it. Effectively, the web application can use both mechanisms, cookies or URL parameters, or even switch from one to the other (automatic URL rewriting) if certain conditions are met (for example, the existence of web clients without cookies support or when cookies are not accepted due to user privacy concerns). &lt;br /&gt;
&lt;br /&gt;
For this reason, it is crucial to differentiate between the mechanisms used by the web application (by default) to exchange session IDs and the mechanisms accepted by the web application to process and manage session IDs. Web applications must limit the accepted session tracking mechanisms to only those selected and used by design. &lt;br /&gt;
&lt;br /&gt;
== Transport Layer Security  ==&lt;br /&gt;
&lt;br /&gt;
In order to protect the session ID exchange from active eavesdropping and passive disclosure in the network traffic, it is mandatory to use an encrypted HTTPS (SSL/TLS) connection for the entire web session, not only for the authentication process where the user credentials are exchanged. &lt;br /&gt;
&lt;br /&gt;
Additionally, the “Secure” cookie attribute (see below) must be used to ensure the session ID is only exchanged through an encrypted channel. The usage of an encrypted communication channel also protects the session against some session fixation attacks where the attacker is able to intercept and manipulate the web traffic to inject (or fix) the session ID on the victims web browser [4]. &lt;br /&gt;
&lt;br /&gt;
The following set of HTTPS (SSL/TLS) best practices are focused on protecting the session ID (specifically when cookies are used) and helping with the integration of HTTPS within the web application: &lt;br /&gt;
&lt;br /&gt;
*Web applications should never switch a given session from HTTP to HTTPS, or viceversa, as this will disclose the session ID in the clear through the network. &lt;br /&gt;
*Web applications should not mix encrypted and unencrypted contents (HTML pages, images, CSS, Javascript files, etc) on the same host (or even domain - see the “domain” cookie attribute), as the request of any web object over an unencrypted channel might disclose the session ID. &lt;br /&gt;
*Web applications, in general, should not offer public unencrypted contents and private encrypted contents from the same host. It is recommended to instead use two different hosts, such as www.example.com over HTTP (unencrypted) for the public contents, and secure.example.com over HTTPS (encrypted) for the private and sensitive contents (where sessions exist). The former host only has port TCP/80 open, while the later only has port TCP/443 open. &lt;br /&gt;
*Web applications should avoid the extremely common HTTP to HTTPS redirection on the home page (using a 30x HTTP response), as this single unprotected HTTP request/response exchange can be used by an attacker to gather (or fix) a valid session ID.&lt;br /&gt;
* Web applications should make use of “HTTP Strict Transport Security (HSTS)” (previously called STS) to enforce HTTPS connections.&lt;br /&gt;
&lt;br /&gt;
See the OWASP Transport Layer Protection Cheat Sheet: [https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet]. &lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that SSL/TLS (HTTPS) does not protect against session ID prediction, brute force, client-side tampering or fixation. Yet, session ID disclosure and capture from the network traffic is one of the most prevalent attack vectors even today. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Cookies  =&lt;br /&gt;
&lt;br /&gt;
The session ID exchange mechanism based on cookies provides multiple security features in the form of cookie attributes that can be used to protect the exchange of the session ID: &lt;br /&gt;
&lt;br /&gt;
== Secure Attribute  ==&lt;br /&gt;
&lt;br /&gt;
The “Secure” cookie attribute instructs web browsers to only send the cookie through an encrypted HTTPS (SSL/TLS) connection. This session protection mechanism is mandatory to prevent the disclosure of the session ID through MitM (Man-in-the-Middle) attacks. It ensures that an attacker cannot simply capture the session ID from web browser traffic. &lt;br /&gt;
&lt;br /&gt;
Forcing the web application to only use HTTPS for its communication (even when port TCP/80, HTTP, is closed in the web application host) does not protect against session ID disclosure if the “Secure” cookie has not been set - the web browser can be deceived to disclose the session ID over an unencrypted HTTP connection. The attacker can intercept and manipulate the victim user traffic and inject an HTTP unencrypted reference to the web application that will force the web browser to submit the session ID in the clear. &lt;br /&gt;
&lt;br /&gt;
== HttpOnly Attribute  ==&lt;br /&gt;
&lt;br /&gt;
The “HttpOnly” cookie attribute instructs web browsers not to allow scripts (e.g. JavaScript or VBscript) an ability to access the cookies via the DOM document.cookie object. This session ID protection is mandatory to prevent session ID stealing through XSS attacks. &lt;br /&gt;
&lt;br /&gt;
See the OWASP XSS Prevention Cheat Sheet: [https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet]. &lt;br /&gt;
&lt;br /&gt;
== Domain and Path Attributes  ==&lt;br /&gt;
&lt;br /&gt;
The “Domain” cookie attribute instructs web browsers to only send the cookie to the specified domain and all subdomains. If the attribute is not set, by default the cookie will only be sent to the origin server. The “Path” cookie attribute instructs web browsers to only send the cookie to the specified directory or subdirectories (or paths or resources) within the web application. If the attribute is not set, by default the cookie will only be sent for the directory (or path) of the resource requested and setting the cookie. &lt;br /&gt;
&lt;br /&gt;
It is recommended to use a narrow or restricted scope for these two attributes. In this way, the “Domain” attribute should not be set (restricting the cookie just to the origin server) and the “Path” attribute should be set as restrictive as possible to the web application path that makes use of the session ID. &lt;br /&gt;
&lt;br /&gt;
Setting the “Domain” attribute to a too permissive value, such as “example.com” allows an attacker to launch attacks on the session IDs between different hosts and web applications belonging to the same domain, known as cross-subdomain cookies. For example, vulnerabilities in www.example.com might allow an attacker to get access to the session IDs from secure.example.com. &lt;br /&gt;
&lt;br /&gt;
Additionally, it is recommended not to mix web applications of different security levels on the same domain. Vulnerabilities in one of the web applications would allow an attacker to set the session ID for a different web application on the same domain by using a permissive “Domain” attribute (such as “example.com”) which is a technique that can be used in session fixation attacks [4]. &lt;br /&gt;
&lt;br /&gt;
Although the “Path” attribute allows the isolation of session IDs between different web applications using different paths on the same host, it is highly recommended not to run different web applications (especially from different security levels or scopes) on the same host. Other methods can be used by these applications to access the session IDs, such as the “document.cookie” object. Also, any web application can set cookies for any path on that host. &lt;br /&gt;
&lt;br /&gt;
Cookies are vulnerable to DNS spoofing/hijacking/poisoning attacks, where an attacker can manipulate the DNS resolution to force the web browser to disclose the session ID for a given host or domain. &lt;br /&gt;
&lt;br /&gt;
== Expire and Max-Age Attributes  ==&lt;br /&gt;
&lt;br /&gt;
Session management mechanisms based on cookies can make use of two types of cookies, non-persistent (or session) cookies, and persistent cookies. If a cookie presents the “Max-Age” (that has preference over “Expires”) or “Expires” attributes, it will be considered a persistent cookie and will be stored on disk by the web browser based until the expiration time. Typically, session management capabilities to track users after authentication make use of non-persistent cookies. This forces the session to disappear from the client if the current web browser instance is closed. Therefore, it is highly recommended to use non-persistent cookies for session management purposes, so that the session ID does not remain on the web client cache for long periods of time, from where an attacker can obtain it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session ID Life Cycle  =&lt;br /&gt;
&lt;br /&gt;
== Session ID Generation and Verification: Permissive and Strict Session Management  ==&lt;br /&gt;
&lt;br /&gt;
There are two types of session management mechanisms for web applications, permissive and strict, related to session fixation vulnerabilities. The permissive mechanism allow the web application to initially accept any session ID value set by the user as valid, creating a new session for it, while the strict mechanism enforces that the web application will only accept session ID values that have been previously generated by the web application. &lt;br /&gt;
&lt;br /&gt;
Although the most common mechanism in use today is the strict one (more secure). Developers must ensure that the web application does not use a permissive mechanism under certain circumstances. Web applications should never accept a session ID they have never generated, and in case of receiving one, they should generate and offer the user a new valid session ID. Additionally, this scenario should be detected as a suspicious activity and an alert should be generated. &lt;br /&gt;
&lt;br /&gt;
== Manage Session ID as Any Other User Input  ==&lt;br /&gt;
&lt;br /&gt;
Session IDs must be considered untrusted, as any other user input processed by the web application, and they must be thoroughly validated and verified. Depending on the session management mechanism used, the session ID will be received in a GET or POST parameter, in the URL or in an HTTP header (e.g. cookies). If web applications do not validate and filter out invalid session ID values before processing them, they can potentially be used to exploit other web vulnerabilities, such as SQL injection if the session IDs are stored on a relational database, or persistent XSS if the session IDs are stored and reflected back afterwards by the web application. &lt;br /&gt;
&lt;br /&gt;
== Renew the Session ID After Any Privilege Level Change  ==&lt;br /&gt;
&lt;br /&gt;
The session ID must be renewed or regenerated by the web application after any privilege level change within the associated user session. The most common scenario where the session ID regeneration is mandatory is during the authentication process, as the privilege level of the user changes from the unauthenticated (or anonymous) state to the authenticated state. Other common scenarios must also be considered, such as password changes, permission changes or switching from a regular user role to an administrator role within the web application. For all these web application critical pages, previous session IDs have to be ignored, a new session ID must be assigned to every new request received for the critical resource, and the old or previous session ID must be destroyed. &lt;br /&gt;
&lt;br /&gt;
The most common web development frameworks provide session functions and methods to renew the session ID, such as “request.getSession(true) &amp;amp;amp; HttpSession.invalidate()” (J2EE), “Session.Abandon() &amp;amp;amp; Response.Cookies.Add(new…)“ (ASP .NET), or “session_start() &amp;amp;amp; session_regenerate_id(true)” (PHP). &lt;br /&gt;
&lt;br /&gt;
The session ID regeneration is mandatory to prevent session fixation attacks [3], where an attacker sets the session ID on the victims user web browser instead of gathering the victims session ID, as in most of the other session-based attacks, and independently of using HTTP or HTTPS. This protection mitigates the impact of other web-based vulnerabilities that can also be used to launch session fixation attacks, such as HTTP response splitting or XSS [4]. &lt;br /&gt;
&lt;br /&gt;
A complementary recommendation is to use a different session ID or token name (or set of session IDs) pre and post authentication, so that the web application can keep track of anonymous users and authenticated users without the risk of exposing or binding the user session between both states. &lt;br /&gt;
&lt;br /&gt;
== Considerations When Using Multiple Cookies  ==&lt;br /&gt;
&lt;br /&gt;
If the web application uses cookies as the session ID exchange mechanism, and multiple cookies are set for a given session, the web application must verify all cookies (and enforce relationships between them) before allowing access to the user session. &lt;br /&gt;
&lt;br /&gt;
It is very common for web applications to set a user cookie pre-authentication over HTTP to keep track of unauthenticated (or anonymous) users. Once the user authenticates in the web application, a new post-authentication secure cookie is set over HTTPS, and a binding between both cookies and the user session is established. If the web application does not verify both cookies for authenticated sessions, an attacker can make use of the pre-authentication unprotected cookie to get access to the authenticated user session [4]. &lt;br /&gt;
&lt;br /&gt;
Web applications should try to avoid the same cookie name for different paths or domain scopes within the same web application, as this increases the complexity of the solution and potentially introduces scoping issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Expiration  =&lt;br /&gt;
&lt;br /&gt;
In order to minimize the time period an attacker can launch attacks over active sessions and hijack them, it is mandatory to set expiration timeouts for every session, establishing the amount of time a session will remain active. Insufficient session expiration by the web application increases the exposure of other session-based attacks, as for the attacker to be able to reuse a valid session ID and hijack the associated session, it must still be active. &lt;br /&gt;
&lt;br /&gt;
The shorter the session interval is, the lesser the time an attacker has to use the valid session ID. The session expiration timeout values must be set accordingly with the purpose and nature of the web application, and balance security and usability, so that the user can comfortably complete the operations within the web application without his session frequently expiring. Both the idle and absolute timeout values are highly dependent on the criticality of the web application and its data. Common idle timeouts ranges are 2-5 minutes for high-value applications and 15- 30 minutes for low risk applications. &lt;br /&gt;
&lt;br /&gt;
When a session expires, the web application must take active actions to invalidate the session on both sides, client and server. The latter is the most relevant and mandatory from a security perspective. &lt;br /&gt;
&lt;br /&gt;
For most session exchange mechanisms, client side actions to invalidate the session ID are based on clearing out the token value. For example, to invalidate a cookie it is recommended to provide an empty (or invalid) value for the session ID, and set the “Expires” (or “Max-Age”) attribute to a date from the past (in case a persistent cookie is being used): &lt;br /&gt;
&amp;lt;pre&amp;gt;Set-Cookie: id=; Expires=Friday, 17-May-03 18:45:00 GMT &amp;lt;/pre&amp;gt; &lt;br /&gt;
In order to close and invalidate the session on the server side, it is mandatory for the web application to take active actions when the session expires, or the user actively logs out, by using the functions and methods offered by the session management mechanisms, such as “HttpSession.invalidate()” (J2EE), “Session.Abandon()“ (ASP .NET) or “session_destroy()/unset()“ (PHP). &lt;br /&gt;
&lt;br /&gt;
== Automatic Session Expiration  ==&lt;br /&gt;
&lt;br /&gt;
=== Idle Timeout  ===&lt;br /&gt;
&lt;br /&gt;
All sessions should implement an idle or inactivity timeout. This timeout defines the amount of time a session will remain active in case there is no activity in the session, closing and invalidating the session upon the defined idle period since the last HTTP request received by the web application for a given session ID. &lt;br /&gt;
&lt;br /&gt;
The idle timeout limits the chances an attacker has to guess and use a valid session ID from another user. However, if the attacker is able to hijack a given session, the idle timeout does not limit the attacker’s actions, as he can generate activity on the session periodically to keep the session active for longer periods of time. &lt;br /&gt;
&lt;br /&gt;
Session timeout management and expiration must be enforced server-side. If the client is used to enforce the session timeout, for example using the session token or other client parameters to track time references (e.g. number of minutes since login time), an attacker could manipulate these to extend the session duration. &lt;br /&gt;
&lt;br /&gt;
=== Absolute Timeout  ===&lt;br /&gt;
&lt;br /&gt;
All sessions should implement an absolute timeout, regardless of session activity. This timeout defines the maximum amount of time a session can be active, closing and invalidating the session upon the defined absolute period since the given session was initially created by the web application. After invalidating the session, the user is forced to (re)authenticate again in the web application and establish a new session. &lt;br /&gt;
&lt;br /&gt;
The absolute session limits the amount of time an attacker can use a hijacked session and impersonate the victim user. &lt;br /&gt;
&lt;br /&gt;
== Manual Session Expiration  ==&lt;br /&gt;
&lt;br /&gt;
Web applications should provide mechanisms that allow security aware users to actively close their session once they have finished using the web application. &lt;br /&gt;
&lt;br /&gt;
=== Logout Button  ===&lt;br /&gt;
&lt;br /&gt;
Web applications must provide a visible an easily accessible logout (logoff, exit, or close session) button that is available on the web application header or menu and reachable from every web application resource and page, so that the user can manually close the session at any time.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': Unfortunately, not all web applications facilitate users to close their current session. Thus, client-side enhancements such as the PopUp LogOut Firefox add-on [9] allow conscientious users to protect their sessions by helping to close them diligently.&lt;br /&gt;
&lt;br /&gt;
== Web Content Caching  ==&lt;br /&gt;
&lt;br /&gt;
Even after the session has been closed, it might be possible to access the private or sensitive data exchanged within the session through the web browser cache. Therefore, web applications must use restrictive cache directives for all the web traffic exchanged through HTTP and HTTPS, such as the “Cache-Control: no-cache,no-store” and “Pragma: no-cache” HTTP headers [5], and/or equivalent META tags on all or (at least) sensitive web pages. &lt;br /&gt;
&lt;br /&gt;
Independently of the cache policy defined by the web application, if caching web application contents is allowed, the session IDs must never be cached, so it is highly recommended to use the “Cache-Control: no-cache=&amp;quot;Set-Cookie, Set-Cookie2&amp;quot;” directive, to allow web clients to cache everything except the session ID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Additional Client-Side Defenses for Session Management  =&lt;br /&gt;
&lt;br /&gt;
Web applications can complement the previously described session management defenses with additional countermeasures on the client side. Client-side protections, typically in the form of JavaScript checks and verifications, are not bullet proof and can easily be defeated by a skilled attacker, but can introduce another layer of defense that has to be bypassed by intruders. &lt;br /&gt;
&lt;br /&gt;
== Initial Login Timeout  ==&lt;br /&gt;
&lt;br /&gt;
Web applications can use JavaScript code in the login page to evaluate and measure the amount of time since the page was loaded and a session ID was granted. If a login attempt is tried after a specific amount of time, the client code can notify the user that the maximum amount of time to log in has passed and reload the login page, hence retrieving a new session ID. &lt;br /&gt;
&lt;br /&gt;
This extra protection mechanism tries to force the renewal of the session ID pre-authentication, avoiding scenarios where a previously used (or manually set) session ID is reused by the next victim using the same computer, for example, in session fixation attacks. &lt;br /&gt;
&lt;br /&gt;
== Force Session Logout On Web Browser Window Close Events  ==&lt;br /&gt;
&lt;br /&gt;
Web applications can use JavaScript code to capture all the web browser tab or window close (or even back) events and take the appropriate actions to close the current session before closing the web browser, emulating that the user has manually closed the session via the logout button. &lt;br /&gt;
&lt;br /&gt;
== Disable Web Browser Cross-Tab Sessions  ==&lt;br /&gt;
&lt;br /&gt;
Web applications can use JavaScript code once the user has logged in and a session has been established to force the user to reauthenticate if a new web browser tab or window is opened against the same web application. The web application does not want to allow multiple web browser tabs or windows to share the same session. Therefore, the application tries to force the web browser to not share the same session ID simultaneously between them. &lt;br /&gt;
&lt;br /&gt;
'''''NOTE''''': This mechanism cannot be implemented if the session ID is exchanged through cookies, as cookies are shared by all web browser tabs/windows.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
== Automatic Client Logout ==&lt;br /&gt;
&lt;br /&gt;
JavaScript code can be used by the web application in all (or critical) pages to automatically logout client sessions after the idle timeout expires, for example, by redirecting the user to the logout page (the same resource used by the logout button mentioned previously). &lt;br /&gt;
&lt;br /&gt;
The benefit of enhancing the server-side idle timeout functionality with client-side code is that the user can see that the session has finished due to inactivity, or even can be notified in advance that the session is about to expire through a count down timer and warning messages. This user-friendly approach helps to avoid loss of work in web pages that require extensive input data due to server-side silently expired sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Attacks Detection  =&lt;br /&gt;
&lt;br /&gt;
== Session ID Guessing and Brute Force Detection  ==&lt;br /&gt;
&lt;br /&gt;
If an attacker tries to guess or brute force a valid session ID, he needs to launch multiple sequential requests against the target web application using different session IDs from a single (or set of) IP address(es). Additionally, if an attacker tries to analyze the predictability of the session ID (e.g. using statistical analysis), he needs to launch multiple sequential requests from a single (or set of) IP address(es) against the target web application to gather new valid session IDs. &lt;br /&gt;
&lt;br /&gt;
Web applications must be able to detect both scenarios based on the number of attempts to gather (or use) different session IDs and alert and/or block the offending IP address(es). &lt;br /&gt;
&lt;br /&gt;
== Detecting Session ID Anomalies  ==&lt;br /&gt;
&lt;br /&gt;
Web applications should focus on detecting anomalies associated to the session ID, such as its manipulation. The OWASP AppSensor Project [7] provides a framework and methodology to implement built-in intrusion detection capabilities within web applications focused on the detection of anomalies and unexpected behaviors, in the form of detection points and response actions. Instead of using external protection layers, sometimes the business logic details and advanced intelligence are only available from inside the web application, where it is possible to establish multiple session related detection points, such as when an existing cookie is modified or deleted, a new cookie is added, the session ID from another user is reused, or when the user location or User-Agent changes in the middle of a session. &lt;br /&gt;
&lt;br /&gt;
== Binding the Session ID to Other User Properties  ==&lt;br /&gt;
&lt;br /&gt;
With the goal of detecting user misbehaviors and session hijacking, it is highly recommended to bind the session ID to other user or client properties, such as the client IP address, User-Agent, or client-based digital certificate. If the web application detects any change or anomaly between these different properties in the middle of an established session, it is a very good indicator of session manipulation and hijacking attempts, and this simple fact can be used to alert and/or terminate the suspicious session. &lt;br /&gt;
&lt;br /&gt;
Although these properties cannot be used by web applications to trustily defend against session attacks, they significantly increase the web application detection capabilities. A skilled attacker can bypass these controls by reusing the same IP address assigned to the victim user by sharing the same network (very common in NAT environments, like Wi-Fi hotspots), by using the same outbound web proxy (very common in corporate environments), or by modifying his User-Agent to look exactly as the victim users does. &lt;br /&gt;
&lt;br /&gt;
== Logging Sessions Life Cycle: Monitoring Creation, Usage, and Destruction of Session IDs  ==&lt;br /&gt;
&lt;br /&gt;
Web applications should increase their logging capabilities by including information regarding the full life cycle of sessions. In particular, it is recommended to record session related events, such as the creation, renewal, and destruction of session IDs, as well as details about its usage within login and logout operations, privilege level changes within the session, timeout expiration, invalid session activities (when detected), and critical business operations during the session. &lt;br /&gt;
&lt;br /&gt;
The log details might include a timestamp, source IP address, web target resource requested (and involved in a session operation), HTTP headers (including the User-Agent and Referer), GET and POST parameters, error codes and messages, username (or user ID), plus the session ID (cookies, URL, GET, POST…). Sensitive data like the session ID should not be included in the logs in order to protect the session logs against session ID local or remote disclosure or unauthorized access. However, some kind of session-specific information must be logged into order to correlate log entries to specific sessions. It is recommended to log a salted-hash of the session ID instead of the session ID itself in order to allow for session-specific log correlation without exposing the session ID.&lt;br /&gt;
&lt;br /&gt;
In particular, web applications must thoroughly protect administrative interfaces that allow to manage all the current active sessions. Frequently these are used by support personnel to solve session related issues, or even general issues, by impersonating the user and looking at the web application as the user does.&lt;br /&gt;
&lt;br /&gt;
The session logs become one of the main web application intrusion detection data sources, and can also be used by intrusion protection systems to automatically terminate sessions and/or disable user accounts when (one or many) attacks are detected. If active protections are implemented, these defensive actions must be logged too.&lt;br /&gt;
&lt;br /&gt;
== Simultaneous Session Logons  ==&lt;br /&gt;
&lt;br /&gt;
It is the web application design decision to determine if multiple simultaneous logons from the same user are allowed from the same or from different client IP addresses. If the web application does not want to allow simultaneous session logons, it must take effective actions after each new authentication event, implicitly terminating the previously available session, or asking the user (through the old, new or both sessions) about the session that must remain active. &lt;br /&gt;
&lt;br /&gt;
It is recommended for web applications to add user capabilities that check the details of active sessions at any time, monitor and alert the user about concurrent logons, provide user features to remotely terminate sessions manually, and track account activity history (logbook) by recording multiple client details such as IP address, User-Agent, login date and time, idle time, etc. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Management WAF Protections  =&lt;br /&gt;
&lt;br /&gt;
There are situations where the web application source code is not available or cannot be modified, or when the changes required to implement the multiple security recommendations and best practices detailed above imply a full redesign of the web application architecture, and therefore, cannot be easily implemented in the short term. In these scenarios, or to complement the web application defenses, and with the goal of keeping the web application as secure as possible, it is recommended to use external protections such as Web Application Firewalls (WAFs) that can mitigate the session management threats already described. &lt;br /&gt;
&lt;br /&gt;
Web Application Firewalls offer detection and protection capabilities against session based attacks. On the one hand, it is trivial for WAFs to enforce the usage of security attributes on cookies, such as the “Secure” and “HttpOnly” flags, applying basic rewriting rules on the “Set-Cookie” header for all the web application responses that set a new cookie. On the other hand, more advanced capabilities can be implemented to allow the WAF to keep track of sessions, and the corresponding session IDs, and apply all kind of protections against session fixation (by renewing the session ID on the client-side when privilege changes are detected), enforcing sticky sessions (by verifying the relationship between the session ID and other client properties, like the IP address or User-Agent), or managing session expiration (by forcing both the client and the web application to finalize the session). &lt;br /&gt;
&lt;br /&gt;
The open-source ModSecurity WAF, plus the OWASP Core Rule Set [6], provide capabilities to detect and apply security cookie attributes, countermeasures against session fixation attacks, and session tracking features to enforce sticky sessions. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Related Articles  =&lt;br /&gt;
&lt;br /&gt;
[0] '''OWASP Cookies Database. OWASP.''' https://www.owasp.org/index.php/Category:OWASP_Cookies_Database &lt;br /&gt;
&lt;br /&gt;
[1] '''&amp;quot;HTTP State Management Mechanism&amp;quot;. RFC 6265. IETF.''' http://tools.ietf.org/html/rfc6265 &lt;br /&gt;
&lt;br /&gt;
[2] '''Insufficient Session-ID Length. OWASP.''' https://www.owasp.org/index.php/Insufficient_Session-ID_Length &lt;br /&gt;
&lt;br /&gt;
[3] '''Session Fixation. Mitja Kolšek. 2002.''' http://www.acrossecurity.com/papers/session_fixation.pdf &lt;br /&gt;
&lt;br /&gt;
[4] '''&amp;quot;SAP: Session (Fixation) Attacks and Protections (in Web Applications)&amp;quot;. Raul Siles. BlackHat EU 2011.''' &lt;br /&gt;
&lt;br /&gt;
https://media.blackhat.com/bh-eu-11/Raul_Siles/BlackHat_EU_2011_Siles_SAP_Session-Slides.pdf &lt;br /&gt;
&lt;br /&gt;
https://media.blackhat.com/bh-eu-11/Raul_Siles/BlackHat_EU_2011_Siles_SAP_Session-WP.pdf &lt;br /&gt;
&lt;br /&gt;
[5] '''&amp;quot;Hypertext Transfer Protocol -- HTTP/1.1&amp;quot;. RFC2616. IETF.''' http://tools.ietf.org/html/rfc2616 &lt;br /&gt;
&lt;br /&gt;
[6] '''OWASP ModSecurity Core Rule Set (CSR) Project. OWASP.''' https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project &lt;br /&gt;
&lt;br /&gt;
[7] '''OWASP AppSensor Project. OWASP.''' https://www.owasp.org/index.php/Category:OWASP_AppSensor_Project &lt;br /&gt;
&lt;br /&gt;
[8] '''HttpOnly Session ID in URL and Page Body | Cross Site Scripting''' http://seckb.yehg.net/2012/06/httponly-session-id-in-url-and-page.html&lt;br /&gt;
&lt;br /&gt;
[9] '''PopUp LogOut Firefox add-on''' https://addons.mozilla.org/en-US/firefox/addon/popup-logout/ &amp;amp; http://popuplogout.iniqua.com&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
Raul Siles - raul[at]taddong.com &lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>John Keller</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Session_Management_Cheat_Sheet&amp;diff=152467</id>
		<title>Session Management Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Session_Management_Cheat_Sheet&amp;diff=152467"/>
				<updated>2013-05-29T19:28:48Z</updated>
		
		<summary type="html">&lt;p&gt;John Keller: conscious&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction  =&lt;br /&gt;
&lt;br /&gt;
'''Web Authentication, Session Management, and Access Control''' &lt;br /&gt;
&lt;br /&gt;
A web session is a sequence of network HTTP request and response transactions associated to the same user. Modern and complex web applications require the retaining of information or status about each user for the duration of multiple requests. Therefore, sessions provide the ability to establish variables – such as access rights and localization settings – which will apply to each and every interaction a user has with the web application for the duration of the session. &lt;br /&gt;
&lt;br /&gt;
Web applications can create sessions to keep track of anonymous users after the very first user request. An example would be maintaining the user language preference. Additionally, web applications will make use of sessions once the user has authenticated. This ensures the ability to identify the user on any subsequent requests as well as being able to apply security access controls, authorized access to the user private data, and to increase the usability of the application. Therefore, current web applications can provide session capabilities both pre and post authentication. &lt;br /&gt;
&lt;br /&gt;
Once an authenticated session has been established, the session ID (or token) is temporarily equivalent to the strongest authentication method used by the application, such as username and password, passphrases, one-time passwords (OTP), client-based digital certificates, smartcards, or biometrics (such as fingerprint or eye retina). See the OWASP Authentication Cheat Sheet: [https://www.owasp.org/index.php/Authentication_Cheat_Sheet https://www.owasp.org/index.php/Authentication_Cheat_Sheet]. &lt;br /&gt;
&lt;br /&gt;
HTTP is a stateless protocol (RFC2616 [5]), where each request and response pair is independent of other web interactions. Therefore, in order to introduce the concept of a session, it is required to implement session management capabilities that link both the authentication and access control (or authorization) modules commonly available in web applications: &lt;br /&gt;
&lt;br /&gt;
[[Image:Session-Management-Diagram Cheat-Sheet.png|center|Session-Management-Diagram Cheat-Sheet.png]] &amp;lt;br&amp;gt; The session ID or token binds the user authentication credentials (in the form of a user session) to the user HTTP traffic and the appropriate access controls enforced by the web application. The complexity of these three components (authentication, session management, and access control) in modern web applications, plus the fact that its implementation and binding resides on the web developer’s hands (as web development framework do not provide strict relationships between these modules), makes the implementation of a secure session management module very challenging. &lt;br /&gt;
&lt;br /&gt;
The disclosure, capture, prediction, brute force, or fixation of the session ID will lead to session hijacking (or sidejacking) attacks, where an attacker is able to fully impersonate a victim user in the web application. Attackers can perform two types of session hijacking attacks, targeted or generic. In a targeted attack, the attacker’s goal is to impersonate a specific (or privileged) web application victim user. For  generic attacks, the attacker’s goal is to impersonate (or get access as) any valid or legitimate user in the web application. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session ID Properties  =&lt;br /&gt;
&lt;br /&gt;
In order to keep the authenticated state and track the users progress within the web application, applications provide users with a session identifier (session ID or token) that is assigned at session creation time, and is shared and exchanged by the user and the web application for the duration of the session (it is sent on every HTTP request). The session ID is a “name=value” pair. &lt;br /&gt;
&lt;br /&gt;
With the goal of implementing secure session IDs, the generation of identifiers (IDs or tokens) must meet the following properties: &lt;br /&gt;
&lt;br /&gt;
== Session ID Name Fingerprinting  ==&lt;br /&gt;
&lt;br /&gt;
The name used by the session ID should not be extremely descriptive nor offer unnecessary details about the purpose and meaning of the ID. &lt;br /&gt;
&lt;br /&gt;
The session ID names used by the most common web application development frameworks can be easily fingerprinted [0], such as PHPSESSID (PHP), JSESSIONID (J2EE), CFID &amp;amp;amp; CFTOKEN (ColdFusion), ASP.NET_SessionId (ASP .NET), etc. Therefore, the session ID name can disclose the technologies and programming languages used by the web application. &lt;br /&gt;
&lt;br /&gt;
It is recommended to change the default session ID name of the web development framework to a generic name, such as “id”. &lt;br /&gt;
&lt;br /&gt;
== Session ID Length  ==&lt;br /&gt;
&lt;br /&gt;
The session ID must be long enough to prevent brute force attacks, where an attacker can go through the whole range of ID values and verify the existence of valid sessions. &lt;br /&gt;
&lt;br /&gt;
The session ID length must be at least 128 bits (16 bytes). &lt;br /&gt;
&lt;br /&gt;
== Session ID Entropy  ==&lt;br /&gt;
&lt;br /&gt;
The session ID must be unpredictable (random enough) to prevent guessing attacks, where an attacker is able to guess or predict the ID of a valid session through statistical analysis techniques. For this purpose, a good PRNG (Pseudo Random Number Generator) must be used. &lt;br /&gt;
&lt;br /&gt;
The session ID value must provide at least 64 bits of entropy (if a good PRNG is used, this value is estimated to be half the length of the session ID).&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''''NOTE''''': The session ID entropy is really affected by other external and difficult to measure factors, such as the number of concurrent active sessions the web application commonly has, the absolute session expiration timeout, the amount of session ID guesses per second the attacker can make and the target web application can support, etc [2]. If a session ID with an entropy of 64 bits is used, it will take an attacker at least 292 years to successfully guess a valid session ID, assuming the attacker can try 10,000 guesses per second with 100,000 valid simultaneous sessions available in the web application [2]. &lt;br /&gt;
&lt;br /&gt;
== Session ID Content (or Value)  ==&lt;br /&gt;
&lt;br /&gt;
The session ID content (or value) must be meaningless to prevent information disclosure attacks, where an attacker is able to decode the contents of the ID and extract details of the user, the session, or the inner workings of the web application. &lt;br /&gt;
&lt;br /&gt;
The session ID must simply be an identifier on the client side, and its value must never include sensitive information (or PII). The meaning and business or application logic associated to the session ID must be stored on the server side, and specifically, in session objects or in a session management database or repository. The stored information can include the client IP address, User-Agent, e-mail, username, user ID, role, privilege level, access rights, language preferences, account ID, current state, last login, session timeouts, and other internal session details. If the session objects and properties contain sensitive information, such as credit card numbers, it is required to duly encrypt and protect the session management repository. &lt;br /&gt;
&lt;br /&gt;
It is recommended to create cryptographically strong session IDs through the usage of cryptographic hash functions such as SHA1 (160 bits). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Management Implementation  =&lt;br /&gt;
&lt;br /&gt;
The session management implementation defines the exchange mechanism that will be used between the user and the web application to share and continuously exchange the session ID. There are multiple mechanisms available in HTTP to maintain session state within web applications, such as cookies (standard HTTP header), URL parameters (URL rewriting – RFC 2396), URL arguments on GET requests, body arguments on POST requests, such as hidden form fields (HTML forms), or proprietary HTTP headers. &lt;br /&gt;
&lt;br /&gt;
The preferred session ID exchange mechanism should allow defining advanced token properties, such as the token expiration date and time, or granular usage constraints. This is one of the reasons why cookies (RFCs 2109 &amp;amp;amp; 2965 &amp;amp;amp; 6265 [1]) are one of the most extensively used session ID exchange mechanisms, offering advanced capabilities not available in other methods. &lt;br /&gt;
&lt;br /&gt;
The usage of specific session ID exchange mechanisms, such as those where the ID is included in the URL, might disclose the session ID (in web links and logs, web browser history and bookmarks, the Referer header or search engines), as well as facilitate other attacks, such as the manipulation of the ID or session fixation attacks [3]. &lt;br /&gt;
&lt;br /&gt;
== Built-in Session Management Implementations  ==&lt;br /&gt;
&lt;br /&gt;
Web development frameworks, such as J2EE, ASP .NET, PHP, and others, provide their own session management features and associated implementation. It is recommended to use these built-in frameworks versus building a home made one from scratch, as they are used worldwide on multiple web environments and have been tested by the web application security and development communities over time. &lt;br /&gt;
&lt;br /&gt;
However, be advised that these frameworks have also presented vulnerabilities and weaknesses in the past, so it is always recommended to use the latest version available, that potentially fixes all the well-known vulnerabilities, as well as review and change the default configuration to enhance its security by following the recommendations described along this document. &lt;br /&gt;
&lt;br /&gt;
The storage capabilities or repository used by the session management mechanism to temporarily save the session IDs must be secure, protecting the session IDs against local or remote accidental disclosure or unauthorized access. &lt;br /&gt;
&lt;br /&gt;
== Used vs. Accepted Session ID Exchange Mechanisms  ==&lt;br /&gt;
&lt;br /&gt;
A specific web application can make use of a particular session ID exchange mechanism by default, such as cookies. However, if a user submits a session ID through a different exchange mechanism, such as a URL parameter, the web application might accept it. Effectively, the web application can use both mechanisms, cookies or URL parameters, or even switch from one to the other (automatic URL rewriting) if certain conditions are met (for example, the existence of web clients without cookies support or when cookies are not accepted due to user privacy concerns). &lt;br /&gt;
&lt;br /&gt;
For this reason, it is crucial to differentiate between the mechanisms used by the web application (by default) to exchange session IDs and the mechanisms accepted by the web application to process and manage session IDs. Web applications must limit the accepted session tracking mechanisms to only those selected and used by design. &lt;br /&gt;
&lt;br /&gt;
== Transport Layer Security  ==&lt;br /&gt;
&lt;br /&gt;
In order to protect the session ID exchange from active eavesdropping and passive disclosure in the network traffic, it is mandatory to use an encrypted HTTPS (SSL/TLS) connection for the entire web session, not only for the authentication process where the user credentials are exchanged. &lt;br /&gt;
&lt;br /&gt;
Additionally, the “Secure” cookie attribute (see below) must be used to ensure the session ID is only exchanged through an encrypted channel. The usage of an encrypted communication channel also protects the session against some session fixation attacks where the attacker is able to intercept and manipulate the web traffic to inject (or fix) the session ID on the victims web browser [4]. &lt;br /&gt;
&lt;br /&gt;
The following set of HTTPS (SSL/TLS) best practices are focused on protecting the session ID (specifically when cookies are used) and helping with the integration of HTTPS within the web application: &lt;br /&gt;
&lt;br /&gt;
*Web applications should never switch a given session from HTTP to HTTPS, or viceversa, as this will disclose the session ID in the clear through the network. &lt;br /&gt;
*Web applications should not mix encrypted and unencrypted contents (HTML pages, images, CSS, Javascript files, etc) on the same host (or even domain - see the “domain” cookie attribute), as the request of any web object over an unencrypted channel might disclose the session ID. &lt;br /&gt;
*Web applications, in general, should not offer public unencrypted contents and private encrypted contents from the same host. It is recommended to instead use two different hosts, such as www.example.com over HTTP (unencrypted) for the public contents, and secure.example.com over HTTPS (encrypted) for the private and sensitive contents (where sessions exist). The former host only has port TCP/80 open, while the later only has port TCP/443 open. &lt;br /&gt;
*Web applications should avoid the extremely common HTTP to HTTPS redirection on the home page (using a 30x HTTP response), as this single unprotected HTTP request/response exchange can be used by an attacker to gather (or fix) a valid session ID.&lt;br /&gt;
* Web applications should make use of “HTTP Strict Transport Security (HSTS)” (previously called STS) to enforce HTTPS connections.&lt;br /&gt;
&lt;br /&gt;
See the OWASP Transport Layer Protection Cheat Sheet: [https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet]. &lt;br /&gt;
&lt;br /&gt;
It is important to emphasize that SSL/TLS (HTTPS) does not protect against session ID prediction, brute force, client-side tampering or fixation. Yet, session ID disclosure and capture from the network traffic is one of the most prevalent attack vectors even today. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Cookies  =&lt;br /&gt;
&lt;br /&gt;
The session ID exchange mechanism based on cookies provides multiple security features in the form of cookie attributes that can be used to protect the exchange of the session ID: &lt;br /&gt;
&lt;br /&gt;
== Secure Attribute  ==&lt;br /&gt;
&lt;br /&gt;
The “Secure” cookie attribute instructs web browsers to only send the cookie through an encrypted HTTPS (SSL/TLS) connection. This session protection mechanism is mandatory to prevent the disclosure of the session ID through MitM (Man-in-the-Middle) attacks. It ensures that an attacker cannot simply capture the session ID from web browser traffic. &lt;br /&gt;
&lt;br /&gt;
Forcing the web application to only use HTTPS for its communication (even when port TCP/80, HTTP, is closed in the web application host) does not protect against session ID disclosure if the “Secure” cookie has not been set - the web browser can be deceived to disclose the session ID over an unencrypted HTTP connection. The attacker can intercept and manipulate the victim user traffic and inject an HTTP unencrypted reference to the web application that will force the web browser to submit the session ID in the clear. &lt;br /&gt;
&lt;br /&gt;
== HttpOnly Attribute  ==&lt;br /&gt;
&lt;br /&gt;
The “HttpOnly” cookie attribute instructs web browsers not to allow scripts (e.g. JavaScript or VBscript) an ability to access the cookies via the DOM document.cookie object. This session ID protection is mandatory to prevent session ID stealing through XSS attacks. &lt;br /&gt;
&lt;br /&gt;
See the OWASP XSS Prevention Cheat Sheet: [https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet]. &lt;br /&gt;
&lt;br /&gt;
== Domain and Path Attributes  ==&lt;br /&gt;
&lt;br /&gt;
The “Domain” cookie attribute instructs web browsers to only send the cookie to the specified domain and all subdomains. If the attribute is not set, by default the cookie will only be sent to the origin server. The “Path” cookie attribute instructs web browsers to only send the cookie to the specified directory or subdirectories (or paths or resources) within the web application. If the attribute is not set, by default the cookie will only be sent for the directory (or path) of the resource requested and setting the cookie. &lt;br /&gt;
&lt;br /&gt;
It is recommended to use a narrow or restricted scope for these two attributes. In this way, the “Domain” attribute should not be set (restricting the cookie just to the origin server) and the “Path” attribute should be set as restrictive as possible to the web application path that makes use of the session ID. &lt;br /&gt;
&lt;br /&gt;
Setting the “Domain” attribute to a too permissive value, such as “example.com” allows an attacker to launch attacks on the session IDs between different hosts and web applications belonging to the same domain, known as cross-subdomain cookies. For example, vulnerabilities in www.example.com might allow an attacker to get access to the session IDs from secure.example.com. &lt;br /&gt;
&lt;br /&gt;
Additionally, it is recommended not to mix web applications of different security levels on the same domain. Vulnerabilities in one of the web applications would allow an attacker to set the session ID for a different web application on the same domain by using a permissive “Domain” attribute (such as “example.com”) which is a technique that can be used in session fixation attacks [4]. &lt;br /&gt;
&lt;br /&gt;
Although the “Path” attribute allows the isolation of session IDs between different web applications using different paths on the same host, it is highly recommended not to run different web applications (especially from different security levels or scopes) on the same host. Other methods can be used by these applications to access the session IDs, such as the “document.cookie” object. Also, any web application can set cookies for any path on that host. &lt;br /&gt;
&lt;br /&gt;
Cookies are vulnerable to DNS spoofing/hijacking/poisoning attacks, where an attacker can manipulate the DNS resolution to force the web browser to disclose the session ID for a given host or domain. &lt;br /&gt;
&lt;br /&gt;
== Expire and Max-Age Attributes  ==&lt;br /&gt;
&lt;br /&gt;
Session management mechanisms based on cookies can make use of two types of cookies, non-persistent (or session) cookies, and persistent cookies. If a cookie presents the “Max-Age” (that has preference over “Expires”) or “Expires” attributes, it will be considered a persistent cookie and will be stored on disk by the web browser based until the expiration time. Typically, session management capabilities to track users after authentication make use of non-persistent cookies. This forces the session to disappear from the client if the current web browser instance is closed. Therefore, it is highly recommended to use non-persistent cookies for session management purposes, so that the session ID does not remain on the web client cache for long periods of time, from where an attacker can obtain it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session ID Life Cycle  =&lt;br /&gt;
&lt;br /&gt;
== Session ID Generation and Verification: Permissive and Strict Session Management  ==&lt;br /&gt;
&lt;br /&gt;
There are two types of session management mechanisms for web applications, permissive and strict, related to session fixation vulnerabilities. The permissive mechanism allow the web application to initially accept any session ID value set by the user as valid, creating a new session for it, while the strict mechanism enforces that the web application will only accept session ID values that have been previously generated by the web application. &lt;br /&gt;
&lt;br /&gt;
Although the most common mechanism in use today is the strict one (more secure). Developers must ensure that the web application does not use a permissive mechanism under certain circumstances. Web applications should never accept a session ID they have never generated, and in case of receiving one, they should generate and offer the user a new valid session ID. Additionally, this scenario should be detected as a suspicious activity and an alert should be generated. &lt;br /&gt;
&lt;br /&gt;
== Manage Session ID as Any Other User Input  ==&lt;br /&gt;
&lt;br /&gt;
Session IDs must be considered untrusted, as any other user input processed by the web application, and they must be thoroughly validated and verified. Depending on the session management mechanism used, the session ID will be received in a GET or POST parameter, in the URL or in an HTTP header (e.g. cookies). If web applications do not validate and filter out invalid session ID values before processing them, they can potentially be used to exploit other web vulnerabilities, such as SQL injection if the session IDs are stored on a relational database, or persistent XSS if the session IDs are stored and reflected back afterwards by the web application. &lt;br /&gt;
&lt;br /&gt;
== Renew the Session ID After Any Privilege Level Change  ==&lt;br /&gt;
&lt;br /&gt;
The session ID must be renewed or regenerated by the web application after any privilege level change within the associated user session. The most common scenario where the session ID regeneration is mandatory is during the authentication process, as the privilege level of the user changes from the unauthenticated (or anonymous) state to the authenticated state. Other common scenarios must also be considered, such as password changes, permission changes or switching from a regular user role to an administrator role within the web application. For all these web application critical pages, previous session IDs have to be ignored, a new session ID must be assigned to every new request received for the critical resource, and the old or previous session ID must be destroyed. &lt;br /&gt;
&lt;br /&gt;
The most common web development frameworks provide session functions and methods to renew the session ID, such as “request.getSession(true) &amp;amp;amp; HttpSession.invalidate()” (J2EE), “Session.Abandon() &amp;amp;amp; Response.Cookies.Add(new…)“ (ASP .NET), or “session_start() &amp;amp;amp; session_regenerate_id(true)” (PHP). &lt;br /&gt;
&lt;br /&gt;
The session ID regeneration is mandatory to prevent session fixation attacks [3], where an attacker sets the session ID on the victims user web browser instead of gathering the victims session ID, as in most of the other session-based attacks, and independently of using HTTP or HTTPS. This protection mitigates the impact of other web-based vulnerabilities that can also be used to launch session fixation attacks, such as HTTP response splitting or XSS [4]. &lt;br /&gt;
&lt;br /&gt;
A complementary recommendation is to use a different session ID or token name (or set of session IDs) pre and post authentication, so that the web application can keep track of anonymous users and authenticated users without the risk of exposing or binding the user session between both states. &lt;br /&gt;
&lt;br /&gt;
== Considerations When Using Multiple Cookies  ==&lt;br /&gt;
&lt;br /&gt;
If the web application uses cookies as the session ID exchange mechanism, and multiple cookies are set for a given session, the web application must verify all cookies (and enforce relationships between them) before allowing access to the user session. &lt;br /&gt;
&lt;br /&gt;
It is very common for web applications to set a user cookie pre-authentication over HTTP to keep track of unauthenticated (or anonymous) users. Once the user authenticates in the web application, a new post-authentication secure cookie is set over HTTPS, and a binding between both cookies and the user session is established. If the web application does not verify both cookies for authenticated sessions, an attacker can make use of the pre-authentication unprotected cookie to get access to the authenticated user session [4]. &lt;br /&gt;
&lt;br /&gt;
Web applications should try to avoid the same cookie name for different paths or domain scopes within the same web application, as this increases the complexity of the solution and potentially introduces scoping issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Expiration  =&lt;br /&gt;
&lt;br /&gt;
In order to minimize the time period an attacker can launch attacks over active sessions and hijack them, it is mandatory to set expiration timeouts for every session, establishing the amount of time a session will remain active. Insufficient session expiration by the web application increases the exposure of other session-based attacks, as for the attacker to be able to reuse a valid session ID and hijack the associated session, it must still be active. &lt;br /&gt;
&lt;br /&gt;
The shorter the session interval is, the lesser the time an attacker has to use the valid session ID. The session expiration timeout values must be set accordingly with the purpose and nature of the web application, and balance security and usability, so that the user can comfortably complete the operations within the web application without his session frequently expiring. Both the idle and absolute timeout values are highly dependent on the criticality of the web application and its data. Common idle timeouts ranges are 2-5 minutes for high-value applications and 15- 30 minutes for low risk applications. &lt;br /&gt;
&lt;br /&gt;
When a session expires, the web application must take active actions to invalidate the session on both sides, client and server. The latter is the most relevant and mandatory from a security perspective. &lt;br /&gt;
&lt;br /&gt;
For most session exchange mechanisms, client side actions to invalidate the session ID are based on clearing out the token value. For example, to invalidate a cookie it is recommended to provide an empty (or invalid) value for the session ID, and set the “Expires” (or “Max-Age”) attribute to a date from the past (in case a persistent cookie is being used): &lt;br /&gt;
&amp;lt;pre&amp;gt;Set-Cookie: id=; Expires=Friday, 17-May-03 18:45:00 GMT &amp;lt;/pre&amp;gt; &lt;br /&gt;
In order to close and invalidate the session on the server side, it is mandatory for the web application to take active actions when the session expires, or the user actively logs out, by using the functions and methods offered by the session management mechanisms, such as “HttpSession.invalidate()” (J2EE), “Session.Abandon()“ (ASP .NET) or “session_destroy()/unset()“ (PHP). &lt;br /&gt;
&lt;br /&gt;
== Automatic Session Expiration  ==&lt;br /&gt;
&lt;br /&gt;
=== Idle Timeout  ===&lt;br /&gt;
&lt;br /&gt;
All sessions should implement an idle or inactivity timeout. This timeout defines the amount of time a session will remain active in case there is no activity in the session, closing and invalidating the session upon the defined idle period since the last HTTP request received by the web application for a given session ID. &lt;br /&gt;
&lt;br /&gt;
The idle timeout limits the chances an attacker has to guess and use a valid session ID from another user. However, if the attacker is able to hijack a given session, the idle timeout does not limit the attacker’s actions, as he can generate activity on the session periodically to keep the session active for longer periods of time. &lt;br /&gt;
&lt;br /&gt;
Session timeout management and expiration must be enforced server-side. If the client is used to enforce the session timeout, for example using the session token or other client parameters to track time references (e.g. number of minutes since login time), an attacker could manipulate these to extend the session duration. &lt;br /&gt;
&lt;br /&gt;
=== Absolute Timeout  ===&lt;br /&gt;
&lt;br /&gt;
All sessions should implement an absolute timeout, regardless of session activity. This timeout defines the maximum amount of time a session can be active, closing and invalidating the session upon the defined absolute period since the given session was initially created by the web application. After invalidating the session, the user is forced to (re)authenticate again in the web application and establish a new session. &lt;br /&gt;
&lt;br /&gt;
The absolute session limits the amount of time an attacker can use a hijacked session and impersonate the victim user. &lt;br /&gt;
&lt;br /&gt;
== Manual Session Expiration  ==&lt;br /&gt;
&lt;br /&gt;
Web applications should provide mechanisms that allow security aware users to actively close their session once they have finished using the web application. &lt;br /&gt;
&lt;br /&gt;
=== Logout Button  ===&lt;br /&gt;
&lt;br /&gt;
Web applications must provide a visible an easily accessible logout (logoff, exit, or close session) button that is available on the web application header or menu and reachable from every web application resource and page, so that the user can manually close the session at any time.&lt;br /&gt;
&lt;br /&gt;
'''NOTE''': Unfortunately, not all web applications facilitate users to close their current session. Thus, client-side enhancements such as the PopUp LogOut Firefox add-on [9] allow conscious users to protect their sessions by helping to close them diligently.&lt;br /&gt;
&lt;br /&gt;
== Web Content Caching  ==&lt;br /&gt;
&lt;br /&gt;
Even after the session has been closed, it might be possible to access the private or sensitive data exchanged within the session through the web browser cache. Therefore, web applications must use restrictive cache directives for all the web traffic exchanged through HTTP and HTTPS, such as the “Cache-Control: no-cache,no-store” and “Pragma: no-cache” HTTP headers [5], and/or equivalent META tags on all or (at least) sensitive web pages. &lt;br /&gt;
&lt;br /&gt;
Independently of the cache policy defined by the web application, if caching web application contents is allowed, the session IDs must never be cached, so it is highly recommended to use the “Cache-Control: no-cache=&amp;quot;Set-Cookie, Set-Cookie2&amp;quot;” directive, to allow web clients to cache everything except the session ID. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Additional Client-Side Defenses for Session Management  =&lt;br /&gt;
&lt;br /&gt;
Web applications can complement the previously described session management defenses with additional countermeasures on the client side. Client-side protections, typically in the form of JavaScript checks and verifications, are not bullet proof and can easily be defeated by a skilled attacker, but can introduce another layer of defense that has to be bypassed by intruders. &lt;br /&gt;
&lt;br /&gt;
== Initial Login Timeout  ==&lt;br /&gt;
&lt;br /&gt;
Web applications can use JavaScript code in the login page to evaluate and measure the amount of time since the page was loaded and a session ID was granted. If a login attempt is tried after a specific amount of time, the client code can notify the user that the maximum amount of time to log in has passed and reload the login page, hence retrieving a new session ID. &lt;br /&gt;
&lt;br /&gt;
This extra protection mechanism tries to force the renewal of the session ID pre-authentication, avoiding scenarios where a previously used (or manually set) session ID is reused by the next victim using the same computer, for example, in session fixation attacks. &lt;br /&gt;
&lt;br /&gt;
== Force Session Logout On Web Browser Window Close Events  ==&lt;br /&gt;
&lt;br /&gt;
Web applications can use JavaScript code to capture all the web browser tab or window close (or even back) events and take the appropriate actions to close the current session before closing the web browser, emulating that the user has manually closed the session via the logout button. &lt;br /&gt;
&lt;br /&gt;
== Disable Web Browser Cross-Tab Sessions  ==&lt;br /&gt;
&lt;br /&gt;
Web applications can use JavaScript code once the user has logged in and a session has been established to force the user to reauthenticate if a new web browser tab or window is opened against the same web application. The web application does not want to allow multiple web browser tabs or windows to share the same session. Therefore, the application tries to force the web browser to not share the same session ID simultaneously between them. &lt;br /&gt;
&lt;br /&gt;
'''''NOTE''''': This mechanism cannot be implemented if the session ID is exchanged throughout cookies, as cookies are shared by all web browser tab/windows, but via a URL argument.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
== Automatic Client Logout ==&lt;br /&gt;
&lt;br /&gt;
JavaScript code can be used by the web application in all (or critical) pages to automatically logout client sessions after the idle timeout expires, for example, by redirecting the user to the logout page (the same resource used by the logout button mentioned previously). &lt;br /&gt;
&lt;br /&gt;
The benefit of enhancing the server-side idle timeout functionality with client-side code is that the user can see that the session has finished due to inactivity, or even can be notified in advance that the session is about to expire through a count down timer and warning messages. This user-friendly approach helps to avoid loss of work in web pages that require extensive input data due to server-side silently expired sessions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Attacks Detection  =&lt;br /&gt;
&lt;br /&gt;
== Session ID Guessing and Brute Force Detection  ==&lt;br /&gt;
&lt;br /&gt;
If an attacker tries to guess or brute force a valid session ID, he needs to launch multiple sequential requests against the target web application using different session IDs from a single (or set of) IP address(es). Additionally, if an attacker tries to analyze the predictability of the session ID (e.g. using statistical analysis), he needs to launch multiple sequential requests from a single (or set of) IP address(es) against the target web application to gather new valid session IDs. &lt;br /&gt;
&lt;br /&gt;
Web applications must be able to detect both scenarios based on the number of attempts to gather (or use) different session IDs and alert and/or block the offending IP address(es). &lt;br /&gt;
&lt;br /&gt;
== Detecting Session ID Anomalies  ==&lt;br /&gt;
&lt;br /&gt;
Web applications should focus on detecting anomalies associated to the session ID, such as its manipulation. The OWASP AppSensor Project [7] provides a framework and methodology to implement built-in intrusion detection capabilities within web applications focused on the detection of anomalies and unexpected behaviors, in the form of detection points and response actions. Instead of using external protection layers, sometimes the business logic details and advanced intelligence are only available from inside the web application, where it is possible to establish multiple session related detection points, such as when an existing cookie is modified or deleted, a new cookie is added, the session ID from another user is reused, or when the user location or User-Agent changes in the middle of a session. &lt;br /&gt;
&lt;br /&gt;
== Binding the Session ID to Other User Properties  ==&lt;br /&gt;
&lt;br /&gt;
With the goal of detecting user misbehaviors and session hijacking, it is highly recommended to bind the session ID to other user or client properties, such as the client IP address, User-Agent, or client-based digital certificate. If the web application detects any change or anomaly between these different properties in the middle of an established session, it is a very good indicator of session manipulation and hijacking attempts, and this simple fact can be used to alert and/or terminate the suspicious session. &lt;br /&gt;
&lt;br /&gt;
Although these properties cannot be used by web applications to trustily defend against session attacks, they significantly increase the web application detection capabilities. A skilled attacker can bypass these controls by reusing the same IP address assigned to the victim user by sharing the same network (very common in NAT environments, like Wi-Fi hotspots), by using the same outbound web proxy (very common in corporate environments), or by modifying his User-Agent to look exactly as the victim users does. &lt;br /&gt;
&lt;br /&gt;
== Logging Sessions Life Cycle: Monitoring Creation, Usage, and Destruction of Session IDs  ==&lt;br /&gt;
&lt;br /&gt;
Web applications should increase their logging capabilities by including information regarding the full life cycle of sessions. In particular, it is recommended to record session related events, such as the creation, renewal, and destruction of session IDs, as well as details about its usage within login and logout operations, privilege level changes within the session, timeout expiration, invalid session activities (when detected), and critical business operations during the session. &lt;br /&gt;
&lt;br /&gt;
The log details might include a timestamp, source IP address, web target resource requested (and involved in a session operation), HTTP headers (including the User-Agent and Referer), GET and POST parameters, error codes and messages, username (or user ID), plus the session ID (cookies, URL, GET, POST…). Sensitive data like the session ID should not be included in the logs in order to protect the session logs against session ID local or remote disclosure or unauthorized access. However, some kind of session-specific information must be logged into order to correlate log entries to specific sessions. It is recommended to log a salted-hash of the session ID instead of the session ID itself in order to allow for session-specific log correlation without exposing the session ID.&lt;br /&gt;
&lt;br /&gt;
In particular, web applications must thoroughly protect administrative interfaces that allow to manage all the current active sessions. Frequently these are used by support personnel to solve session related issues, or even general issues, by impersonating the user and looking at the web application as the user does.&lt;br /&gt;
&lt;br /&gt;
The session logs become one of the main web application intrusion detection data sources, and can also be used by intrusion protection systems to automatically terminate sessions and/or disable user accounts when (one or many) attacks are detected. If active protections are implemented, these defensive actions must be logged too.&lt;br /&gt;
&lt;br /&gt;
== Simultaneous Session Logons  ==&lt;br /&gt;
&lt;br /&gt;
It is the web application design decision to determine if multiple simultaneous logons from the same user are allowed from the same or from different client IP addresses. If the web application does not want to allow simultaneous session logons, it must take effective actions after each new authentication event, implicitly terminating the previously available session, or asking the user (through the old, new or both sessions) about the session that must remain active. &lt;br /&gt;
&lt;br /&gt;
It is recommended for web applications to add user capabilities that check the details of active sessions at any time, monitor and alert the user about concurrent logons, provide user features to remotely terminate sessions manually, and track account activity history (logbook) by recording multiple client details such as IP address, User-Agent, login date and time, idle time, etc. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Session Management WAF Protections  =&lt;br /&gt;
&lt;br /&gt;
There are situations where the web application source code is not available or cannot be modified, or when the changes required to implement the multiple security recommendations and best practices detailed above imply a full redesign of the web application architecture, and therefore, cannot be easily implemented in the short term. In these scenarios, or to complement the web application defenses, and with the goal of keeping the web application as secure as possible, it is recommended to use external protections such as Web Application Firewalls (WAFs) that can mitigate the session management threats already described. &lt;br /&gt;
&lt;br /&gt;
Web Application Firewalls offer detection and protection capabilities against session based attacks. On the one hand, it is trivial for WAFs to enforce the usage of security attributes on cookies, such as the “Secure” and “HttpOnly” flags, applying basic rewriting rules on the “Set-Cookie” header for all the web application responses that set a new cookie. On the other hand, more advanced capabilities can be implemented to allow the WAF to keep track of sessions, and the corresponding session IDs, and apply all kind of protections against session fixation (by renewing the session ID on the client-side when privilege changes are detected), enforcing sticky sessions (by verifying the relationship between the session ID and other client properties, like the IP address or User-Agent), or managing session expiration (by forcing both the client and the web application to finalize the session). &lt;br /&gt;
&lt;br /&gt;
The open-source ModSecurity WAF, plus the OWASP Core Rule Set [6], provide capabilities to detect and apply security cookie attributes, countermeasures against session fixation attacks, and session tracking features to enforce sticky sessions. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
= Related Articles  =&lt;br /&gt;
&lt;br /&gt;
[0] '''OWASP Cookies Database. OWASP.''' https://www.owasp.org/index.php/Category:OWASP_Cookies_Database &lt;br /&gt;
&lt;br /&gt;
[1] '''&amp;quot;HTTP State Management Mechanism&amp;quot;. RFC 6265. IETF.''' http://tools.ietf.org/html/rfc6265 &lt;br /&gt;
&lt;br /&gt;
[2] '''Insufficient Session-ID Length. OWASP.''' https://www.owasp.org/index.php/Insufficient_Session-ID_Length &lt;br /&gt;
&lt;br /&gt;
[3] '''Session Fixation. Mitja Kolšek. 2002.''' http://www.acrossecurity.com/papers/session_fixation.pdf &lt;br /&gt;
&lt;br /&gt;
[4] '''&amp;quot;SAP: Session (Fixation) Attacks and Protections (in Web Applications)&amp;quot;. Raul Siles. BlackHat EU 2011.''' &lt;br /&gt;
&lt;br /&gt;
https://media.blackhat.com/bh-eu-11/Raul_Siles/BlackHat_EU_2011_Siles_SAP_Session-Slides.pdf &lt;br /&gt;
&lt;br /&gt;
https://media.blackhat.com/bh-eu-11/Raul_Siles/BlackHat_EU_2011_Siles_SAP_Session-WP.pdf &lt;br /&gt;
&lt;br /&gt;
[5] '''&amp;quot;Hypertext Transfer Protocol -- HTTP/1.1&amp;quot;. RFC2616. IETF.''' http://tools.ietf.org/html/rfc2616 &lt;br /&gt;
&lt;br /&gt;
[6] '''OWASP ModSecurity Core Rule Set (CSR) Project. OWASP.''' https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project &lt;br /&gt;
&lt;br /&gt;
[7] '''OWASP AppSensor Project. OWASP.''' https://www.owasp.org/index.php/Category:OWASP_AppSensor_Project &lt;br /&gt;
&lt;br /&gt;
[8] '''HttpOnly Session ID in URL and Page Body | Cross Site Scripting''' http://seckb.yehg.net/2012/06/httponly-session-id-in-url-and-page.html&lt;br /&gt;
&lt;br /&gt;
[9] '''PopUp LogOut Firefox add-on''' https://addons.mozilla.org/en-US/firefox/addon/popup-logout/ &amp;amp; http://popuplogout.iniqua.com&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
Raul Siles - raul[at]taddong.com &lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>John Keller</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_AntiSamy_Project&amp;diff=123210</id>
		<title>Category:OWASP AntiSamy Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_AntiSamy_Project&amp;diff=123210"/>
				<updated>2012-01-25T17:26:36Z</updated>
		
		<summary type="html">&lt;p&gt;John Keller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it? ==&lt;br /&gt;
&lt;br /&gt;
The OWASP AntiSamy project is a few things. Technically, it is an API for ensuring user-supplied HTML/CSS is in compliance within an application's rules. Another way of saying that could be: It's an API that helps you make sure that clients don't supply malicious cargo code in the HTML they supply for their profile, comments, etc., that get persisted on the server. The term &amp;quot;malicious code&amp;quot; in regards to web applications usually mean &amp;quot;JavaScript.&amp;quot; Cascading Stylesheets are only considered malicious when they invoke the JavaScript engine. However, there are many situations where &amp;quot;normal&amp;quot; HTML and CSS can be used in a malicious manner. So we take care of that too.&lt;br /&gt;
&lt;br /&gt;
Philosophically, AntiSamy is a departure from contemporary security mechanisms. Generally, the security mechanism and user have a communication that is virtually one way, for good reason. Letting the potential attacker know details about the validation is considered unwise as it allows the attacker to &amp;quot;learn&amp;quot; and &amp;quot;recon&amp;quot; the mechanism for weaknesses. These types of information leaks can also hurt in ways you don't expect. A login mechanism that tells the user, &amp;quot;Username invalid&amp;quot; leaks the fact that a user by that name does not exist. A user could use a dictionary or phone book or both to remotely come up with a list of valid usernames. Using this information, an attacker could launch a brute force attack or massive account lock denial-of-service. We get that.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, that's just not very usable in this situation. Typical Internet users are largely pretty bad when it comes to writing HTML/CSS, so where do they get their HTML from? Usually they copy it from somewhere out on the web. Simply rejecting their input without any clue as to why is jolting and annoying. Annoyed users go somewhere else to do their social networking.&lt;br /&gt;
&lt;br /&gt;
The [[OWASP_Licenses|OWASP licensing policy]] (further explained in the [[Membership|membership FAQ]]) allows OWASP projects to be released under any [http://www.opensource.org/licenses/alphabetical approved open source license]. Under these guidelines, AntiSamy is distributed under a [http://www.opensource.org/licenses/bsd-license.php BSD license].&lt;br /&gt;
&lt;br /&gt;
== Who are you? ==&lt;br /&gt;
&lt;br /&gt;
AntiSamy was originally authored by Arshan Dabirsiaghi (arshan.dabirsiaghi [at the] gmail.com) with help from Jason Li (li.jason.c [at the] gmail.com), both of Aspect Security (http://www.aspectsecurity.com/).&lt;br /&gt;
&lt;br /&gt;
== What's the difference between AntiSamy Java, .NET, etc.? ==&lt;br /&gt;
&lt;br /&gt;
[[AntiSamy Version Differences|This page]] shows a big-picture comparison between the versions. Since it's an unfunded open source project, the ports can't be expected to mirror functionality exactly. If there's something a port is missing -- let us know, and we'll try to accommodate, or write a patch!  &lt;br /&gt;
&lt;br /&gt;
== How do I get started? ==&lt;br /&gt;
&lt;br /&gt;
There's 4 steps in the process of integrating AntiSamy. Each step is detailed in the next section, but the high level overview follows:&lt;br /&gt;
# Download AntiSamy from [http://code.google.com/p/owaspantisamy/downloads/list its home on Google Code]&lt;br /&gt;
# Choose one of the standard policy files that matches as close to the functionality you need:&lt;br /&gt;
#* antisamy-tinymce-X.X.X.xml&lt;br /&gt;
#* antisamy-slashdot-X.X.X.xml&lt;br /&gt;
#* antisamy-ebay-X.X.X.xml&lt;br /&gt;
#* antisamy-myspace-X.X.X.xml&lt;br /&gt;
#* antisamy-anythinggoes-X.X.X.xml&lt;br /&gt;
# Tailor the policy file according to your site's rules&lt;br /&gt;
# Call the API from the code&lt;br /&gt;
&lt;br /&gt;
=== Stage 1 - Downloading AntiSamy ===&lt;br /&gt;
&lt;br /&gt;
The following instructions are for AntiSamy Java, the main version. For instructions on the .NET version, see [[the .NET page]].&lt;br /&gt;
&lt;br /&gt;
Which package you download depends on what you want to do with AntiSamy. If you'd like to extend it or review the code, download the source package '''antisamy-X.X.X-src.jar'''. If you're looking to integrate AntiSamy, you can either download the library or use Maven to include it in your build. If you want to use Maven, here's [[an example POM for including AntiSamy]]. If you want a jar file, then download the '''antisamy-X.X.X.jar''' (which, before version 1.2 was confusingly called &amp;quot;antisamy-standalone-X.X.X.jar&amp;quot;), which only contains AntiSamy library. This will be the preferred choice for mature enterprise environments who don't want to be caught in classpath issues which may be introduced by the current version.&lt;br /&gt;
&lt;br /&gt;
The second option, ''only available for versions before 1.2,'' is to download '''antisamy-standalone-X.X.X.jar''', which contains not only the AntiSamy code, but all necessary supporting libraries. This should only be used by applications that don't use the libraries AntiSamy ships with as they might introduce classpath and versioning issues. ''This option is no longer available after version 1.2.''&lt;br /&gt;
&lt;br /&gt;
You must also download required dependencies, which are documented in the '''Developer Guide.pdf''' file.&lt;br /&gt;
&lt;br /&gt;
You can Download AntiSamy from [http://code.google.com/p/owaspantisamy/downloads/list its home on Google Code]&lt;br /&gt;
&lt;br /&gt;
=== Stage 2 - Choosing a base policy file ===&lt;br /&gt;
&lt;br /&gt;
Chances are that your site's use case for AntiSamy is at least roughly comparable to one of the predefined policy files. They each represent a &amp;quot;typical&amp;quot; scenario for allowing users to provide HTML (and possibly CSS) formatting information. Let's look into the different policy files:&lt;br /&gt;
&lt;br /&gt;
1) antisamy-slashdot.xml&lt;br /&gt;
&lt;br /&gt;
Slashdot (http://www.slashdot.org/) is a techie news site that allows users to respond anonymously to news posts with very limited HTML markup. Now Slashdot is not only one of the coolest sites around, it's also one that's been subject to many different successful attacks. Even more unfortunate is the fact that most of the attacks led users to the infamous goatse.cx picture (please don't go look it up). The rules for Slashdot are fairly strict: users can only submit the following HTML tags and no CSS: &amp;amp;lt;b&amp;amp;gt;, &amp;amp;lt;u&amp;amp;gt;, &amp;amp;lt;i&amp;amp;gt;, &amp;amp;lt;a&amp;amp;gt;, &amp;amp;lt;blockquote&amp;amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Accordingly, we've built a policy file that allows fairly similar functionality. All text-formatting tags that operate directly on the font, color or emphasis have been allowed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) antisamy-ebay.xml&lt;br /&gt;
&lt;br /&gt;
eBay (http://www.ebay.com/) is the most popular online auction site in the universe, as far as I can tell. It is a public site so anyone is allowed to post listings with rich HTML content. It's not surprising that given the attractiveness of eBay as a target that it has been subject to a few complex XSS attacks. Listings are allowed to contain much more rich content than, say, Slashdot- so it's attack surface is considerably larger. The following tags appear to be accepted by eBay (they don't publish rules): &amp;lt;a&amp;gt;,...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) antisamy-myspace.xml&lt;br /&gt;
&lt;br /&gt;
MySpace (http://www.myspace.com/) is arguably the most popular social networking site today. Users are allowed to submit pretty much all HTML and CSS they want - as long as it doesn't contain JavaScript. MySpace is currently using a word blacklist to validate users' HTML, which is why they were subject to the infamous Samy worm (http://namb.la/). The Samy worm, which used fragmentation attacks combined with a word that should have been blacklisted (eval) - was the inspiration for the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) antisamy-anythinggoes.xml&lt;br /&gt;
&lt;br /&gt;
I don't know of a possible use case for this policy file. If you wanted to allow every single valid HTML and CSS element (but without JavaScript or blatant CSS-related phishing attacks), you can use this policy file. Not even MySpace is _this_ crazy. However, it does serve as a good reference because it contains base rules for every element, so you can use it as a knowledge base when using tailoring the other policy files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Stage 3 - Tailoring the policy file ===&lt;br /&gt;
&lt;br /&gt;
Smaller organizations may want to deploy AntiSamy in a default configuration, but it's equally likely that a site may want to have strict, business-driven rules for what users can allow. The discussion that decides the tailoring should also consider attack surface - which grows in relative proportion to the policy file.&lt;br /&gt;
&lt;br /&gt;
You may also want to enable/modify some &amp;quot;directives&amp;quot;, which are basically advanced user options. [[AntiSamy Directives|This page]] tells you what the directives are and which versions support them.&lt;br /&gt;
&lt;br /&gt;
=== Stage 4 - Calling the AntiSamy API ===&lt;br /&gt;
&lt;br /&gt;
Using AntiSamy is abnormally easy. Here is an example of invoking AntiSamy with a policy file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;import org.owasp.validator.html.*;&lt;br /&gt;
&lt;br /&gt;
Policy policy = Policy.getInstance(POLICY_FILE_LOCATION);&lt;br /&gt;
&lt;br /&gt;
AntiSamy as = new AntiSamy();&lt;br /&gt;
CleanResults cr = as.scan(dirtyInput, policy);&lt;br /&gt;
&lt;br /&gt;
MyUserDAO.storeUserProfile(cr.getCleanHTML()); // some custom function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few ways to create a Policy object. The &amp;lt;code&amp;gt;getInstance()&amp;lt;/code&amp;gt; method can take any of the following:&lt;br /&gt;
* a String filename&lt;br /&gt;
* a File object&lt;br /&gt;
* an InputStream &lt;br /&gt;
&lt;br /&gt;
Policy files can also be referenced by filename by passing a second argument to the &amp;lt;code&amp;gt;AntiSamy:scan()&amp;lt;/code&amp;gt; method as the following examples show.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;AntiSamy as = new AntiSamy();&lt;br /&gt;
CleanResults cr = as.scan(dirtyInput, policyFilePath);&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, policy files can also be referenced by File objects directly in the second parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;AntiSamy as = new AntiSamy();&lt;br /&gt;
CleanResults cr = as.scan(dirtyInput, new File(policyFilePath));&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stage 5 - Analyzing CleanResults ===&lt;br /&gt;
&lt;br /&gt;
The CleanResults object provides a lot of useful stuff. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;getErrorMessages()&amp;lt;/code&amp;gt; - a list of &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt; error messages&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;getCleanHTML()&amp;lt;/code&amp;gt; - the clean, safe HTML output&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;getCleanXMLDocumentFragment()&amp;lt;/code&amp;gt; - the clean, safe &amp;lt;code&amp;gt;XMLDocumentFragment&amp;lt;/code&amp;gt; which is reflected in &amp;lt;code&amp;gt;getCleanHTML()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;getScanTime()&amp;lt;/code&amp;gt; - returns the scan time in seconds&lt;br /&gt;
&lt;br /&gt;
== Project roadmap ==&lt;br /&gt;
&lt;br /&gt;
This section details the status of the various ports of AntiSamy.&lt;br /&gt;
&lt;br /&gt;
=== Grails ===&lt;br /&gt;
Daniel Bower created a [http://www.grails.org/plugin/sanitizer Grails plugin] for AntiSamy.&lt;br /&gt;
&lt;br /&gt;
=== .NET ===&lt;br /&gt;
A .NET port of AntiSamy is available now at the [[:Category:OWASP AntiSamy Project .NET|OWASP AntiSamy .NET]] page. The project was funded by a Summer of Code 2008 grant and was developed by Jerry Hoff. &lt;br /&gt;
&lt;br /&gt;
This port is no longer under active development, and is looking for a few good developers to help make it feature-synchronized with the .NET version. If it doesn't suit your needs, consider Microsoft's [http://blogs.msdn.com/b/securitytools/archive/2009/09/01/html-sanitization-in-anti-xss-library.aspx AntiXSS] library.&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
A beta Python version is currently being prototyped by a few different groups. As more information becomes available, we will post it here. If you are interested in helping, please contact the mailing list.&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
Although a PHP version was initially planned, we now suggest [http://htmlpurifier.org HTMLPurifier] for safe rich input validation for PHP applications.&lt;br /&gt;
&lt;br /&gt;
== Presentations on AntiSamy ==&lt;br /&gt;
&lt;br /&gt;
From OWASP &amp;amp; WASC AppSec U.S. 2007 Conference (San Jose, CA): [http://www.owasp.org/images/e/e9/OWASP-WASCAppSec2007SanJose_AntiSamy.ppt AntiSamy - Picking a Fight with XSS (ppt)] - by Arshan Dabirsiaghi - AntiSamy project lead&lt;br /&gt;
&lt;br /&gt;
From OWASP AppSec Europe 2008 (Ghent, Belgium): [http://www.owasp.org/images/4/47/AppSecEU08-AntiSamy.ppt The OWASP AntiSamy project (ppt)] - by Jason Li - AntiSamy project contributor&lt;br /&gt;
&lt;br /&gt;
From OWASP AppSec India 2008 (Delhi, India): [https://www.owasp.org/images/9/9d/AppSecIN08-ValidatingRichUserContent.ppt Validating Rich User Content (ppt)] - by Jason Li - AntiSamy project contributor&lt;br /&gt;
&lt;br /&gt;
From Shmoocon 2009 (Washington, DC): [http://www.shmoocon.org/2009/slides/OWASP%20Winter%202009%20Shmoocon%20-%20Anti%20Samy.pptx AntiSamy - Picking a Fight with XSS (pptx)] - by Arshan Dabirsiaghi - AntiSamy project lead&lt;br /&gt;
&lt;br /&gt;
== Contacting us ==&lt;br /&gt;
There are two ways of getting information on AntiSamy. The mailing list, and contacting the project lead directly.&lt;br /&gt;
&lt;br /&gt;
=== OWASP AntiSamy mailing list ===&lt;br /&gt;
The first is the mailing list which is located at https://lists.owasp.org/mailman/listinfo/owasp-antisamy. The list was previously private and the archives have been cleared with the release of version 1.0. We encourage all prospective and current users and bored attackers to join in the conversation. We're happy to brainstorm attack scenarios, discuss regular expressions and help with integration.&lt;br /&gt;
&lt;br /&gt;
=== Emailing the project lead ===&lt;br /&gt;
&lt;br /&gt;
For content which is not appropriate for the public mailing list, you can alternatively contact the project lead, Arshan Dabirsiaghi, at [arshan.dabirsiaghi] at [aspectsecurity.com].&lt;br /&gt;
&lt;br /&gt;
=== Issue tracking ===&lt;br /&gt;
&lt;br /&gt;
Visit the [http://code.google.com/p/owaspantisamy/issues/list Google Code issue tracker].&lt;br /&gt;
&lt;br /&gt;
== Sponsors ==&lt;br /&gt;
&lt;br /&gt;
The AntiSamy project is sponsored by {{MemberLinks|link=http://www.aspectsecurity.com|logo=Aspect_logo_owasp.jpg}}&lt;br /&gt;
&lt;br /&gt;
The initial Java project was sponsored by the [[OWASP Spring Of Code 2007|OWASP Spring Of Code 2007]]. The .NET project was sponsored by the [[OWASP Summer of Code 2008]].&lt;br /&gt;
&lt;br /&gt;
== Project's Assessment ==&lt;br /&gt;
&lt;br /&gt;
This project was assessed by [[:User:Jeff Williams|Jeff Williams]] and his evaluation can be seen [http://spreadsheets.google.com/ccc?key=pAX6n7m2zaTW-JtGBqixbTw '''here'''].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project|AntiSamy Project]]&lt;br /&gt;
[[Category:OWASP Tool]]&lt;br /&gt;
[[Category:OWASP Download]]&lt;br /&gt;
[[Category:OWASP Release Quality Tool]]&lt;br /&gt;
&lt;br /&gt;
{{OWASP Builders}}&lt;/div&gt;</summary>
		<author><name>John Keller</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Help:Contents&amp;diff=123198</id>
		<title>Help:Contents</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Help:Contents&amp;diff=123198"/>
				<updated>2012-01-25T17:09:39Z</updated>
		
		<summary type="html">&lt;p&gt;John Keller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page has some pointers to useful documentation for dealing with OWASP's Wiki.&lt;br /&gt;
&lt;br /&gt;
There is an [https://www.owasp.org/index.php/Help:Editing Editing Help] page (linked to at the bottom of every edit page) that has some useful material. If you are making small changes or only textual (as compared to formatting) then the information on that page should be fine. If you are making larger changes, look for an article that looks like what you want and steal the formatting. Remember, you can edit nearly every page so if you want to copy some formatting, for example, if you want to copy some formatting off of the [https://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project About OWASP] page (something you should probably never edit without great care and discussion), you can still click the edit link and copy the formatting. The Wiki does some page locking so it is generally better to hit the &amp;quot;Cancel&amp;quot; link after you have copied-and-pasted. If you forget, it is not big deal as there is a timeout on the lock so it will fix itself eventually. For example, the previously mentioned [https://www.owasp.org/index.php/Help:Editing Editing Help] page has about as complex a table as you could want and you can copy the formatting for that table and use it.&lt;br /&gt;
&lt;br /&gt;
Should you be looking for something that is more complicated or you want more extensive documentation to help you out, then the [http://www.wikipedia.org/en Wikipedia's] help pages are your best bet. Both the OWASP Wiki and the Wikipedia are powered by the same Wiki engine, [http://www.mediawiki.org/ MediaWiki]. &lt;br /&gt;
&lt;br /&gt;
The following are some jumping off points for the Wikipedia's help pages:&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Help:Editing Wikipedia's &amp;quot;Editing Help&amp;quot;]: Similar to OWASP's &amp;quot;Editing Help&amp;quot; page.&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet The Wikipedia Cheatsheet]: A quick reference guide.&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates A Quick Guide to Templates]: Templates are a macro feature that can be used for everything from reducing typing to giving multiple pages a common look-and-feel. They are not used very much in OWASP's Wiki although I do not know why. While the Wikipedia and OWASP's Wiki share the same Wiki engine, the Wikipedia has added a rather large collection of templates that are not found in OWASP so do not be surprised if some of the documentation about specific templates is incorrect.&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Help:Magic_words Magic Words]: At least some of these magic words work (e.g.: the &amp;quot;&amp;lt;nowiki&amp;gt;__TOC__&amp;lt;/nowiki&amp;gt;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Please update this page if you have further updates.&lt;/div&gt;</summary>
		<author><name>John Keller</name></author>	</entry>

	</feed>