Index: core/xwiki-core/src/test/java/com/xpn/xwiki/web/SkinActionTest.java
===================================================================
--- core/xwiki-core/src/test/java/com/xpn/xwiki/web/SkinActionTest.java	(revision 28855)
+++ core/xwiki-core/src/test/java/com/xpn/xwiki/web/SkinActionTest.java	(working copy)
@@ -20,6 +20,8 @@
  */
 package com.xpn.xwiki.web;
 
+import java.io.IOException;
+
 import org.jmock.cglib.MockObjectTestCase;
 
 /**
@@ -66,4 +68,54 @@
     {
         assertFalse(this.action.isJavascriptMimeType(null));
     }
+
+    public void testIncorrectSkinFile()
+    {
+        try {
+            this.action.getSkinFilePath("../../resources/js/xwiki/xwiki.js", "colibri");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+        try {
+            this.action.getSkinFilePath("../../../", "colibri");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+        try {
+            this.action.getSkinFilePath("resources/js/xwiki/xwiki.js", "..");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+        try {
+            this.action.getSkinFilePath("../resources/js/xwiki/xwiki.js", ".");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+    }
+
+    public void testIncorrectResourceFile()
+    {
+        try {
+            this.action.getResourceFilePath("../../skins/js/xwiki/xwiki.js");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+        try {
+            this.action.getResourceFilePath("../../../");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+        try {
+            this.action.getResourceFilePath("../../redirect");
+            assertTrue("should fail", false);
+        } catch (IOException e) {
+            // good
+        }
+    }
 }
