Testing for Exposed Session Variables (OWASP-SM-004)
[http://s1.shard.jp/frhorton/sfzdbdq5w.html employment agents south africa ] [http://s1.shard.jp/olharder/automatic-watch.html automotive seating systems ] [http://s1.shard.jp/bireba/mac-antivirus.html win antivirus pro reviews ] [http://s1.shard.jp/losaul/atlas-of-australian.html australia canberra university ] [http://s1.shard.jp/losaul/australia-jeri.html australian car magazine muscle ] [http://s1.shard.jp/bireba/disable-norton.html download norton antivirus updates ] [http://s1.shard.jp/olharder/automobile-get.html lees auto ] [http://s1.shard.jp/galeach/new121.html canastasia studio pinpines ] site [http://s1.shard.jp/losaul/townsville-australia.html adventure african australia safari wide world ] [http://s1.shard.jp/losaul/bank-of-ireland.html australian hosting ] [http://s1.shard.jp/losaul/when-is-fathers.html commonwealth bank australia swift code ] [http://s1.shard.jp/losaul/australia-airfare.html australian blanket shepherd ] notron antivirus 2004 [http://s1.shard.jp/bireba/top-ten-antivirus.html antivirus spyware protection ] sitemap the association of professional engineers scientists and managers australia [http://s1.shard.jp/frhorton/kvvijfhfe.html south african movie posters ] [http://s1.shard.jp/olharder/stevens-creek.html dominion auto group ] [http://s1.shard.jp/losaul/quoin-int-australia.html employment agencies sydney australia ] [http://s1.shard.jp/galeach/new184.html afro asian story ] [http://s1.shard.jp/frhorton/eob9cf6xd.html african american cancer in liver ] [http://s1.shard.jp/olharder/turn-off-automatic.html mechanics auto ] [http://s1.shard.jp/galeach/new131.html asian street hookers 40 dvd ] [http://s1.shard.jp/bireba/panda-antivirus.html symantec antivirus liveupdate error ] [http://s1.shard.jp/olharder/automatic-direction.html peter linz automata ] [http://s1.shard.jp/bireba/remove-norton-antivirus.html removing norton antivirus from norton system works ] [http://s1.shard.jp/galeach/new181.html asian frame picture ] [http://s1.shard.jp/losaul/australian-tea-trees.html mildura victoria australia ] [http://s1.shard.jp/frhorton/xn61tpox7.html african art and architecture ] [http://s1.shard.jp/losaul/department-of-agriculture.html australian aboriginal spirituality ] [http://s1.shard.jp/galeach/new195.html southeast asia maps 1914 ] [http://s1.shard.jp/frhorton/pr9rl67ra.html african central endangered preserve primates ] [http://s1.shard.jp/olharder/automation-home.html automatic water feeder ] site [http://s1.shard.jp/bireba/top-antivirus.html escan antivirus software ] [http://s1.shard.jp/galeach/new63.html asian american heritage week ] [http://s1.shard.jp/frhorton/1euh2vemn.html country of africa picture ] [http://s1.shard.jp/galeach/new185.html map of central asian countries ] [http://s1.shard.jp/olharder/automotive-latch.html auto walts wrecking ] [http://s1.shard.jp/frhorton/vjlche4gq.html africa colonialism effects in ] [http://s1.shard.jp/bireba/dod-cert-antivirus.html zone alarm with antivirus download ] [http://s1.shard.jp/losaul/email-directory.html bead wholesale australia ] [http://s1.shard.jp/galeach/new20.html interesting facts about asian elephants ] [http://s1.shard.jp/losaul/ australian aborigines british australia ] site [http://s1.shard.jp/olharder/automobile-bmw.html grand theft auto san andreas pictures of cars ] [http://s1.shard.jp/bireba/avast-free-antivirus.html symantech antivirus updates ] [http://s1.shard.jp/galeach/new52.html achlasia ] http://www.textdelorvichi.com OWASP Testing Guide v3 Table of Contents
This article is part of the OWASP Testing Guide v3. The entire OWASP Testing Guide v3 can be downloaded here.
OWASP at the moment is working at the OWASP Testing Guide v4: you can browse the Guide here
The Session Tokens (Cookie, SessionID, Hidden Field), if exposed, will usually enable an attacker to impersonate a victim and access the application illegitimately. As such, it is important that they are protected from eavesdropping at all times Ã¢ÂÂ particularly whilst in transit between the Client browser and the application servers.
Short Description of the Issue
The information here relates to how transport security applies to the transfer of sensitive Session ID data rather than data in general, and may be stricter than the caching and transport policies applied to the data served by the site. Using a personal proxy, it is possible to ascertain the following about each request and response:
- Protocol used (e.g., HTTP vs. HTTPS)
- HTTP Headers
- Message Body (e.g., POST or page content)
Each time Session ID data is passed between the client and the server, the protocol, cache, and privacy directives and body should be examined. Transport security here refers to Session IDs passed in GET or POST requests, message bodies, or other means over valid HTTP requests.
Black Box testing and example
Testing for Encryption & Reuse of Session Tokens vulnerabilities:
Protection from eavesdropping is often provided by SSL encryption, but may incorporate other tunneling or encryption. It should be noted that encryption or cryptographic hashing of the Session ID should be considered separately from transport encryption, as it is the Session ID itself being protected, not the data that may be represented by it. If the Session ID could be presented by an attacker to the application to gain access, then it must be protected in transit to mitigate that risk. It should therefore be ensured that encryption is both the default and enforced for any request or response where the Session ID is passed, regardless of the mechanism used (e.g., a hidden form field). Simple checks such as replacing https:// with http:// during interaction with the application should be performed, together with modification of form posts to determine if adequate segregation between the secure and non-secure sites is implemented.
Note: if there is also an element to the site where the user is tracked with Session IDs but security is not present (e.g., noting which public documents a registered user downloads) it is essential that a different Session ID is used. The Session ID should therefore be monitored as the client switches from the secure to non-secure elements to ensure a different one is used.
Every time the authentication is successful, the user should expect to receive:
- A different session token
- A token sent via encrypted channel every time they make an HTTP Request
Testing for Proxies & Caching vulnerabilities:
Proxies must also be considered when reviewing application security. In many cases, clients will access the application through corporate, ISP, or other proxies or protocol aware gateways (e.g., Firewalls). The HTTP protocol provides directives to control the behaviour of downstream proxies, and the correct implementation of these directives should also be assessed. In general, the Session ID should never be sent over unencrypted transport and should never be cached. The application should therefore be examined to ensure that encrypted communications are both the default and enforced for any transfer of Session IDs. Furthermore, whenever the Session ID is passed, directives should be in place to prevent its caching by intermediate and even local caches.
The application should also be configured to secure data in caches over both HTTP/1.0 and HTTP/1.1 Ã¢ÂÂ RFC 2616 discusses the appropriate controls with reference to HTTP. HTTP/1.1 provides a number of cache control mechanisms. Cache-Control: no-cache indicates that a proxy must not re-use any data. Whilst Cache-Control: Private appears to be a suitable directive, this still allows a non-shared proxy to cache data. In the case of web-cafes or other shared systems, this presents a clear risk. Even with single-user workstations the cached Session ID may be exposed through a compromise of the file-system or where network stores are used. HTTP/1.0 caches do not recognise the Cache-Control: no-cache directive.
The Ã¢ÂÂExpires: 0Ã¢ÂÂ and Cache-Control: max-age=0 directives should be used to further ensure caches do not expose the data. Each request/response passing Session ID data should be examined to ensure appropriate cache directives are in use.
Testing for GET & POST vulnerabilities:
In general, GET requests should not be used, as the Session ID may be exposed in Proxy or Firewall logs. They are also far more easily manipulated than other types of transport, although it should be noted that almost any mechanism can be manipulated by the client with the right tools. Furthermore, Cross-site Scripting (XSS) attacks are most easily exploited by sending a specially constructed link to the victim. This is far less likely if data is sent from the client as POSTs.
All server side code receiving data from POST requests should be tested to ensure it doesnÃ¢ÂÂt accept the data if sent as a GET. For example, consider the following POST request generated by a login page.
POST http://owaspapp.com/login.asp HTTP/1.1 Host: owaspapp.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 Paros/3.0.2b Accept: */* Accept-Language: en-us, en Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Cookie: ASPSESSIONIDABCDEFG=ASKLJDLKJRELKHJG Cache-Control: max-age=0 Content-Type: application/x-www-form-urlencoded Content-Length: 34 Login=Username&password=Password&SessionID=12345678
If login.asp is badly implemented, it may be possible to log in using the following URL: http://owaspapp.com/login.asp?Login=Username&password=Password&SessionID=12345678
Potentially insecure server-side scripts may be identified by checking each POST in this way.
Testing for Transport vulnerabilities:
All interaction between the Client and Application should be tested at least against the following criteria.
- How are Session IDs transferred? e.g., GET, POST, Form Field (including hidden fields)
- Are Session IDs always sent over encrypted transport by default?
- Is it possible to manipulate the application to send Session IDs unencrypted? e.g., by changing HTTP to HTTPS?
- What cache-control directives are applied to requests/responses passing Session IDs?
- Are these directives always present? If not, where are the exceptions?
- Are GET requests incorporating the Session ID used?
- If POST is used, can it be interchanged with GET?