Thema der Woche: Java Sicherheit und Angriffe

Zur Vorbereitung

  • Suche über die Nutzung von Escape Sequences \uxxxx im Internet und wo sie im Java-Programmcode überall genutzt werden können.
  • Lies über die Methode exec() von Runtime und den ProcessBuilder.
  • Lies über den Klassenlader und Klassenladehierarchien.
  • Mit der Java Compiler API lässt sich ein Java-Programm aus einem anderen Java-Programm heraus übersetzen. Wie sieht die API aus? Seit wann gibt es sie?

http://www.blackhat.com/presentations/bh-usa-09/WILLIAMS/BHUSA09-Williams-EnterpriseJavaRootkits-PAPER.pdf ist ein schöner Artikel, wie Entwickler den Quellcode kompromittieren können, um “böse” Sachen anzustellen. Zwar ist die Information über den Java-Compiler, den der Tomcat nutzt, nicht korrekt, aber Jeff Williams fasst wunderbar verschiedene Angriffsfälle zusammen.

Lies den Text und beantworte folgende Fragen:

  • Welcher Annahme im Programm bei “Abusing the JSP Compiler” wird gemacht? Ist das Beispiel realistisch?
  • Wie lässt es sich verhindern, dass man private Attribute auslesen kann? Lässt sich das in der Praxis realisieren?
  • Was ist BCEL? Seit wann und warum integriert das JDK BCEL?
  • Gibt es Unternehmen (in Deutschland), die Code Audits durchführen? Auch von bekannten Open-Source Libraries?

Wer weiter Interesse an dem Thema hast, kann sich http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-SLIDES.pdf anschauen.

Version 1.3.1 von Google App Engine

Nach fast exakt 2 Monaten gibt es mit der Version 1.3.1 das erste Update der 1.3er Reihe:

JDO/JPA Changes

Die Unterstützung eines Cursors gehört mit den größten Neuerungen. Zudem listet der Blog-Eintrag http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including-major.html auf:

  • Datastore Query Cursors – Cursors allow applications to save and ‚bookmark‘ their progress through a query, so that it can be resumed later. This works great in combination with paging URLs, as well as processing in the Task Queue API, but there are many other uses. Watch for an upcoming blog post that explores Cursors in the near future. They’re also really handy in the context of the next change…
  • No more 1000 result limit – That’s right: with addition of Cursors and the culmination of many smaller Datastore stability and performance improvements over the last few months, we’re now confident enough to remove the maximum result limit altogether. Whether you’re doing a fetch, iterating, or using a Cursor, there’s no limits on the number of results.
  • Reduced error rate with Automatic Datastore Retries – We’ve heard a lot of feedback that you don’t want to deal with the Datastore’s sporadic errors. In response, App Engine now automatically retries all datastore calls (with the exception of transaction commits) when your applications encounters a datastore error caused by being unable to reach Bigtable. Datastore retries automatically builds in what many of you have been doing in your code already, and our tests have shown it drastically reduces the number of errors your application experiences (by up to 3-4x error reduction for puts, 10-30x for gets).

GWT 2.0.1 und GWT 2.0.2

In kurzer Folge hat Google ein erstes Update für die GWT 2-Reihe veröffentlicht. Von http://code.google.com/intl/de/webtoolkit/release-notes.html#Release_Notes_2_0_1:

Release Notes for 2.0.2

This 2.0.2 release contains a couple of fixes that were not included in the 2.0.1 release.

Noteworthy Fixed Issues

  • Standard.css missing new layout styles (#4429)
  • Using a PopupPanel in Internet Explorer without a history IFrame throws a NullPointerException (#4584)

Release Notes for 2.0.1

This 2.0.1 release contains fixes for bugs found in the 2.0.0 release.

Potentially breaking changes and fixes

Noteworthy Fixed Issues

  • UiBinder Image class with resource attribute, removes styles on that image (#4415)
  • Widgets lose focus if its placed on FocusPanel (Opera, Safari) (#1471)
  • Remove method in SplitLayoutPanel is broken (#4217)
  • Splitter constructor hard codes the background color of the splitter to white (#4335)
  • Image should provide method to set alternative text (#4335)
  • CssResource cannot parse unescaped ‚-‚, ‚_‘ in class selectors and unknown at-rules (#3946)
  • Focusable implementation breaks ScrollPanels in Safari (#1313)
  • RequestBuilder restricted to GET and POST (#3388)
  • HTMLTable.Cell.getElement() calls getCellFormatter().getElement() with row and column swapped RequestBuilder restricted to GET and POST (#3757)
  • MenuBar steals focus when hovered (#3884)
  • TabLayoutPanel tabs don’t line up properly on IE (#4447)
  • webAppCreator produces ant build files which support the gwt.args property for passing additional flags to the gwtc and devmode rules, such as ant -Dgwt.args="-style PRETTY" gwtc.

See the GWT issue tracker for the complete list of bug fixes and enhancements in this release.

Genau wie andere auch, hatte ich den Bug #3946 gemeldet und freue mich, dass der CSS-Parser nun auch das „-“ für proprietäre CSS-Stile parst.

Einrücken von mit XMLStreamWriter geschriebenen XML-Dokumenten

Um mal eben schnell ein XML-Dokument zu schreiben ist XMLStreamWriter genau das richtige. Etwas traurig ist, dass er nicht, wie JAXB einen Schalter kennt, um das geschriebene XML-Dokument einzurücken. Hier bietet sich aber ein Filter an, der das tut. In den Klassenpfad nimmt man etwa die beiden Dateien

auf und dekoriert dann seinen eigenen Stream-Writer:

StringWriter stringWriter = new StringWriter(1024);
XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLStreamWriter writer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( stringWriter ) );
writer.writeStartDocument( „utf-8“, „1.0“ );