You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ke...@apache.org on 2013/06/20 15:14:33 UTC

svn commit: r1494972 - /oodt/site/components/maven/apidocs/index.html

Author: kelly
Date: Thu Jun 20 13:14:33 2013
New Revision: 1494972

URL: http://svn.apache.org/r1494972
Log:
Frame injection vulnerability in published Javadoc

Modified:
    oodt/site/components/maven/apidocs/index.html

Modified: oodt/site/components/maven/apidocs/index.html
URL: http://svn.apache.org/viewvc/oodt/site/components/maven/apidocs/index.html?rev=1494972&r1=1494971&r2=1494972&view=diff
==============================================================================
--- oodt/site/components/maven/apidocs/index.html (original)
+++ oodt/site/components/maven/apidocs/index.html Thu Jun 20 13:14:33 2013
@@ -7,6 +7,42 @@ Apache OODT 0.5 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 != "" &amp;&amp; targetPage != "undefined")
              top.classFrame.location = top.targetPage;
@@ -23,4 +59,4 @@ This document is designed to be viewed u
 <br/>
 Link to<a href="overview-summary.html">Non-frame version.</a>
 </p></noframes>
-</frameset></body></html>
\ No newline at end of file
+</frameset></body></html>