You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by le...@apache.org on 2014/08/15 19:59:37 UTC

svn commit: r1618249 - in /gora/site/trunk/content/current/api: apidocs-0.2.1/index.html apidocs-0.2/index.html apidocs-0.3/index.html

Author: lewismc
Date: Fri Aug 15 17:59:36 2014
New Revision: 1618249

URL: http://svn.apache.org/r1618249
Log:
GORA-250 [SECURITY] Frame injection vulnerability in published Javadoc

Modified:
    gora/site/trunk/content/current/api/apidocs-0.2.1/index.html
    gora/site/trunk/content/current/api/apidocs-0.2/index.html
    gora/site/trunk/content/current/api/apidocs-0.3/index.html

Modified: gora/site/trunk/content/current/api/apidocs-0.2.1/index.html
URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/api/apidocs-0.2.1/index.html?rev=1618249&r1=1618248&r2=1618249&view=diff
==============================================================================
--- gora/site/trunk/content/current/api/apidocs-0.2.1/index.html (original)
+++ gora/site/trunk/content/current/api/apidocs-0.2.1/index.html Fri Aug 15 17:59:36 2014
@@ -13,6 +13,42 @@ Apache Gora 0.2.1 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: gora/site/trunk/content/current/api/apidocs-0.2/index.html
URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/api/apidocs-0.2/index.html?rev=1618249&r1=1618248&r2=1618249&view=diff
==============================================================================
--- gora/site/trunk/content/current/api/apidocs-0.2/index.html (original)
+++ gora/site/trunk/content/current/api/apidocs-0.2/index.html Fri Aug 15 17:59:36 2014
@@ -13,6 +13,42 @@ Apache Gora 0.2 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: gora/site/trunk/content/current/api/apidocs-0.3/index.html
URL: http://svn.apache.org/viewvc/gora/site/trunk/content/current/api/apidocs-0.3/index.html?rev=1618249&r1=1618248&r2=1618249&view=diff
==============================================================================
--- gora/site/trunk/content/current/api/apidocs-0.3/index.html (original)
+++ gora/site/trunk/content/current/api/apidocs-0.3/index.html Fri Aug 15 17:59:36 2014
@@ -13,6 +13,42 @@ Apache Gora 0.3 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;